Skip to content

Commit

Permalink
Merge pull request #44 from jim-deriv/jim/feq-2131/fix-subscribe-error
Browse files Browse the repository at this point in the history
fix: fix subscription error
  • Loading branch information
jim-deriv authored Apr 24, 2024
2 parents d27d2d8 + e10af17 commit b8acb70
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 b8acb70

Please sign in to comment.