Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Commit

Permalink
fix: ensure time request is only sent once
Browse files Browse the repository at this point in the history
  • Loading branch information
owenpearson committed Aug 30, 2023
1 parent e2ca52d commit 0677af8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/AblyProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,10 @@ export const AblyProvider = ({

React.useEffect(() => {
if (!hasSentAgent) {
realtime
.request('GET', '/time', { agent: 'react-hooks-time-ping' })
.then(() => {
hasSentAgent = true;
});
hasSentAgent = true;
realtime.request('GET', '/time', {
agent: 'react-hooks-time-ping',
});
}
});

Expand Down

0 comments on commit 0677af8

Please sign in to comment.