Skip to content

Commit

Permalink
Merge pull request #687 from thematters/fix/skip-polling
Browse files Browse the repository at this point in the history
[hotfix - master] Skip polling if the user hasn't logged in
  • Loading branch information
robertu7 authored Feb 10, 2020
2 parents 7c716c4 + 46a74ff commit efe7d29
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/common/enums/time.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const POLL_INTERVAL = 1000 * 10
export const POLL_INTERVAL = 1000 * 20

export const INPUT_DEBOUNCE = 300

Expand Down
4 changes: 3 additions & 1 deletion src/components/GlobalHeader/Nav/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ const Nav = () => {

// FIXME: https://github.com/apollographql/apollo-client/issues/3775
useEffect(() => {
startPolling(POLL_INTERVAL)
if (viewer.isAuthed) {
startPolling(POLL_INTERVAL)
}
}, [])

return (
Expand Down
4 changes: 3 additions & 1 deletion src/components/GlobalHeader/NotificationButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ const NotificationButton = () => {

// FIXME: https://github.com/apollographql/apollo-client/issues/3775
useEffect(() => {
startPolling(POLL_INTERVAL)
if (viewer.isAuthed) {
startPolling(POLL_INTERVAL)
}
}, [])

return (
Expand Down

0 comments on commit efe7d29

Please sign in to comment.