From 666ceda12dc33126bb1e47ca0a6fecc6f397450e Mon Sep 17 00:00:00 2001 From: Kuitos Date: Mon, 11 Mar 2024 21:08:55 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20optimize=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sandbox/patchers/windowListener.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sandbox/patchers/windowListener.ts b/src/sandbox/patchers/windowListener.ts index e09b49d8b..fa578e2bc 100644 --- a/src/sandbox/patchers/windowListener.ts +++ b/src/sandbox/patchers/windowListener.ts @@ -69,8 +69,7 @@ const addCacheListener = ( } const cacheListener = { listener, options, rawListener }; - cachedTypeListeners.push(cacheListener); - listenerMap.set(type, cachedTypeListeners); + listenerMap.set(type, [...cachedTypeListeners, cacheListener]); return cacheListener; };