From f5b1b924a532fa9371c94b24b1bafc5dec8e2296 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun <cheeaun@gmail.com> Date: Wed, 27 Dec 2023 23:44:27 +0800 Subject: [PATCH] More queueMicrotask --- src/app.jsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/app.jsx b/src/app.jsx index 9d7ead64..c09f5626 100644 --- a/src/app.jsx +++ b/src/app.jsx @@ -124,11 +124,13 @@ setInterval(() => { // Related: https://github.com/vitejs/vite/issues/10600 setTimeout(() => { for (const icon in ICONS) { - if (Array.isArray(ICONS[icon])) { - ICONS[icon][0]?.(); - } else { - ICONS[icon]?.(); - } + queueMicrotask(() => { + if (Array.isArray(ICONS[icon])) { + ICONS[icon][0]?.(); + } else { + ICONS[icon]?.(); + } + }); } }, 5000);