From c1c21c2fee11c0015db2621867189a498455c368 Mon Sep 17 00:00:00 2001 From: IndieKKY Date: Sat, 5 Oct 2024 13:45:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/messaging/PortMessageHandler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/messaging/PortMessageHandler.ts b/src/messaging/PortMessageHandler.ts index 08ade69..09880c6 100644 --- a/src/messaging/PortMessageHandler.ts +++ b/src/messaging/PortMessageHandler.ts @@ -51,10 +51,10 @@ class PortMessageHandler { const { resolve, timer } = this.messageMap.get(msgId)!; // 清除超时定时器 clearTimeout(timer); - // 通过 ID 找到对应的 Promise 并 resolve - resolve(res!.data!); // 处理完毕后,移除该消息 ID this.messageMap.delete(msgId); + // 通过 ID 找到对应的 Promise 并 resolve + resolve(res!.data!); } } });