Make notifications init reactive to queryClient (#3329)
This commit is contained in:
parent
fc1e30afd6
commit
6c728f79de
2 changed files with 63 additions and 51 deletions
|
@ -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.`))
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue