Skip to content

Commit

Permalink
Merge pull request #1455 from ably/fix-use-state-errors-missing-id-param
Browse files Browse the repository at this point in the history
fix: add missing id param for `useStateErrors` call to `useChannelStateListener`
  • Loading branch information
owenpearson authored Oct 23, 2023
2 parents a35b65c + 2c94dbf commit c3bac03
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/platform/react-hooks/src/hooks/useStateErrors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ export function useStateErrors(params: ChannelNameAndOptions) {
params.id
);

useConnectionStateListener(['connected', 'closed'], () => {
setConnectionError(null);
});
useConnectionStateListener(
['connected', 'closed'],
() => {
setConnectionError(null);
},
params.id
);

useChannelStateListener(params, ['suspended', 'failed', 'detached'], (stateChange) => {
if (stateChange.reason) {
Expand Down

0 comments on commit c3bac03

Please sign in to comment.