From a36b0ec31f3dba0343baa49a30946220cc79ff1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=8E?= Date: Thu, 14 Jul 2022 16:22:15 +0800 Subject: [PATCH] fix(route): mark handled status immediately (#2) --- src/WS/route/Route.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/WS/route/Route.ts b/src/WS/route/Route.ts index 601a678..b8dfc68 100644 --- a/src/WS/route/Route.ts +++ b/src/WS/route/Route.ts @@ -24,9 +24,10 @@ export default class Route { */ startHandling() { return new Promise((resolve) => { - this.handleResolve = resolve; - }).finally(() => { - this.handleResolve = null; + this.handleResolve = (done) => { + this.handleResolve = null; + resolve(done); + }; }); }