From ae07be5a3bb32dc2fd5cf609281ef1817bf0b0ec Mon Sep 17 00:00:00 2001 From: allen Date: Wed, 27 Oct 2021 19:32:41 +0800 Subject: [PATCH] fix: fix subscription --- src/viteAPI/provider.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/viteAPI/provider.ts b/src/viteAPI/provider.ts index 0d88bc67..6f4b6451 100644 --- a/src/viteAPI/provider.ts +++ b/src/viteAPI/provider.ts @@ -95,7 +95,7 @@ class ProviderClass { const subscription = rep; - if (!Object.keys(this.subscriptionList)) { + if (!Object.keys(this.subscriptionList).length) { this.subscriptionList = {}; this._provider.subscribe && this._provider.subscribe(jsonEvent => { this.subscribeCallback(jsonEvent); @@ -117,7 +117,7 @@ class ProviderClass { private _offReq(_q) { - delete this.requestList[_q.id]; + delete this.requestList[_q._id]; } private _onReq(type, methods, ...args) {