From e10af17011e9742b426030695c1f1d630c2a2be8 Mon Sep 17 00:00:00 2001 From: Jim Daniels Wasswa Date: Wed, 24 Apr 2024 16:32:30 +0800 Subject: [PATCH] fix: fix subscription error --- src/base/use-subscribe.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/use-subscribe.tsx b/src/base/use-subscribe.tsx index 89ab8ff..9ec425d 100644 --- a/src/base/use-subscribe.tsx +++ b/src/base/use-subscribe.tsx @@ -40,7 +40,7 @@ export const useSubscribe = (name: T const matchingSubscription = subscriptions.current?.[id]; if (matchingSubscription) return { id, subscription: matchingSubscription }; - const subscription = derivAPI.current?.subscribe({ [name]: 1, subscribe: 1, ...(payload || {}) }); + const subscription = derivAPI?.subscribe({ [name]: 1, subscribe: 1, ...(payload || {}) }); subscriptions.current = { ...(subscriptions.current || {}), ...{ [id]: subscription } }; return { id, subscription }; };