Make notifications init reactive to queryClient (#3329)

This commit is contained in:
dan 2024-04-03 23:42:28 +01:00 committed by GitHub
parent fc1e30afd6
commit 6c728f79de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 63 additions and 51 deletions

View file

@ -19,8 +19,8 @@ import {init as initPersistedState} from '#/state/persisted'
import * as persisted from '#/state/persisted'
import {Provider as LabelDefsProvider} from '#/state/preferences/label-defs'
import {useIntentHandler} from 'lib/hooks/useIntentHandler'
import {useNotificationsListener} from 'lib/notifications/notifications'
import {useOTAUpdates} from 'lib/hooks/useOTAUpdates'
import * as notifications from 'lib/notifications/notifications'
import {
asyncStoragePersister,
dehydrateOptions,
@ -61,11 +61,11 @@ function InnerApp() {
const theme = useColorModeTheme()
const {_} = useLingui()
useIntentHandler()
useNotificationsListener(queryClient)
useOTAUpdates()
// init
useEffect(() => {
notifications.init(queryClient)
listenSessionDropped(() => {
Toast.show(_(msg`Sorry! Your session expired. Please log in again.`))
})