Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] this.$toast.clear() not working #6

Open
Marc-Pierre-Barbier opened this issue Jun 28, 2022 · 0 comments
Open

[BUG] this.$toast.clear() not working #6

Marc-Pierre-Barbier opened this issue Jun 28, 2022 · 0 comments

Comments

@Marc-Pierre-Barbier
Copy link
Contributor

I have a project that is a simple frontend for an existing server. So I added a functionality that warns the user if the backend is not ready, but when I try to clear the toasts it gives me no errors but do nothing. Maybe it is because I have a lot of toasts queued up ?

	mounted() {
		this.loadProjects()
	},
	methods: {
		loadProjects() {
			fetch('http://localhost:8080/rest/projects').then(async (response) => {
				if(response.status != 200) console.log(response)
				else {
					this.projects = await response.json()
				}
			}).catch((_response) =>  {
				//if nothing was loaded keep trying since it means the server isn't on
				//longer duration than timeout to avoir animations
				this.$toast.clear()
				this.$toast.show('Could not contact the server make sure it is running on port 8080', { maxToasts: 1, type: 'error' })
				setTimeout(this.loadProjects, 1000)
			})
		},

bug vue toast

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant