Replacing `setImmediate` with `setTimeout` (#2683)

* Adding an import for setImmediate

`setImmediate` is a global in node, but
it is technically from the `timers` module,
and it is not global in web.

* Replacing node specific call to `setImmediate`

`setTimeout` is available globally in both node and web
This commit is contained in:
Emma 2022-10-07 10:42:13 -04:00 committed by GitHub
parent bb90218036
commit ac5341b309
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -28,7 +28,7 @@ export default Vue.extend({
open: function (message, action, time) {
const toast = { message: message, action: action || (() => { }), isOpen: false, timeout: null }
toast.timeout = setTimeout(this.close, time || 3000, toast)
setImmediate(() => { toast.isOpen = true })
setTimeout(() => { toast.isOpen = true })
if (this.toasts.length > 4) {
this.remove(0)
}