From ac5341b30935c0fd7c6b5d81fa468072f777a72d Mon Sep 17 00:00:00 2001 From: Emma Date: Fri, 7 Oct 2022 10:42:13 -0400 Subject: [PATCH] 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 --- src/renderer/components/ft-toast/ft-toast.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/components/ft-toast/ft-toast.js b/src/renderer/components/ft-toast/ft-toast.js index be0b4e3e..5c8d541d 100644 --- a/src/renderer/components/ft-toast/ft-toast.js +++ b/src/renderer/components/ft-toast/ft-toast.js @@ -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) }