Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Only re-reg push noty token when account changes (#2654)

authored by

Eric Bailey and committed by
GitHub
96f39657 5ee802bb

+5 -6
+5 -6
src/view/shell/index.tsx
··· 52 52 const canGoBack = useNavigationState(state => !isStateAtTabRoot(state)) 53 53 const {hasSession, currentAccount} = useSession() 54 54 const closeAnyActiveElement = useCloseAnyActiveElement() 55 + // start undefined 56 + const currentAccountDid = React.useRef<string | undefined>(undefined) 55 57 56 58 React.useEffect(() => { 57 59 let listener = {remove() {}} ··· 66 68 }, [closeAnyActiveElement]) 67 69 68 70 React.useEffect(() => { 69 - if (currentAccount) { 71 + // only runs when did changes 72 + if (currentAccount && currentAccountDid.current !== currentAccount.did) { 73 + currentAccountDid.current = currentAccount.did 70 74 notifications.requestPermissionsAndRegisterToken(currentAccount) 71 - } 72 - }, [currentAccount]) 73 - 74 - React.useEffect(() => { 75 - if (currentAccount) { 76 75 const unsub = notifications.registerTokenChangeHandler(currentAccount) 77 76 return unsub 78 77 }