[Session] Drill getAgent
into notifications handlers (#3705)
* Drill into notifications handlers (cherry picked from commit 7ac9e500866732e1f2e205bbe96e70db331e5ffb) * Thread getAgent instead --------- Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
This commit is contained in:
parent
e5fdbfe294
commit
d8c8e1e854
2 changed files with 10 additions and 4 deletions
|
@ -13,7 +13,7 @@ import * as NavigationBar from 'expo-navigation-bar'
|
|||
import {StatusBar} from 'expo-status-bar'
|
||||
import {useNavigationState} from '@react-navigation/native'
|
||||
|
||||
import {useSession} from '#/state/session'
|
||||
import {getAgent, useSession} from '#/state/session'
|
||||
import {
|
||||
useIsDrawerOpen,
|
||||
useIsDrawerSwipeDisabled,
|
||||
|
@ -78,8 +78,11 @@ function ShellInner() {
|
|||
// only runs when did changes
|
||||
if (currentAccount && currentAccountDid.current !== currentAccount.did) {
|
||||
currentAccountDid.current = currentAccount.did
|
||||
notifications.requestPermissionsAndRegisterToken(currentAccount)
|
||||
const unsub = notifications.registerTokenChangeHandler(currentAccount)
|
||||
notifications.requestPermissionsAndRegisterToken(getAgent, currentAccount)
|
||||
const unsub = notifications.registerTokenChangeHandler(
|
||||
getAgent,
|
||||
currentAccount,
|
||||
)
|
||||
return unsub
|
||||
}
|
||||
}, [currentAccount])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue