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:
parent
bb90218036
commit
ac5341b309
|
@ -28,7 +28,7 @@ export default Vue.extend({
|
||||||
open: function (message, action, time) {
|
open: function (message, action, time) {
|
||||||
const toast = { message: message, action: action || (() => { }), isOpen: false, timeout: null }
|
const toast = { message: message, action: action || (() => { }), isOpen: false, timeout: null }
|
||||||
toast.timeout = setTimeout(this.close, time || 3000, toast)
|
toast.timeout = setTimeout(this.close, time || 3000, toast)
|
||||||
setImmediate(() => { toast.isOpen = true })
|
setTimeout(() => { toast.isOpen = true })
|
||||||
if (this.toasts.length > 4) {
|
if (this.toasts.length > 4) {
|
||||||
this.remove(0)
|
this.remove(0)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue