Skip to content

Commit

Permalink
fix: fix subscription error
Browse files Browse the repository at this point in the history
  • Loading branch information
jim-deriv committed Apr 24, 2024
1 parent d27d2d8 commit e10af17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/base/use-subscribe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const useSubscribe = <T extends TSocketSubscribableEndpointNames>(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 };
};
Expand Down

0 comments on commit e10af17

Please sign in to comment.