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 14:42:13 +00:00
committed by GitHub
parent bb90218036
commit ac5341b309
+1 -1
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)
}