mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Improve push experience
This commit is contained in:
14
src/App.tsx
14
src/App.tsx
@ -10,9 +10,10 @@ import sentry from '@root/startup/sentry'
|
||||
import { persistor, store } from '@root/store'
|
||||
import { getSettingsLanguage } from '@utils/slices/settingsSlice'
|
||||
import ThemeManager from '@utils/styles/ThemeManager'
|
||||
import * as Notifications from 'expo-notifications'
|
||||
import * as SplashScreen from 'expo-splash-screen'
|
||||
import React, { useCallback, useEffect, useState } from 'react'
|
||||
import { LogBox, Platform } from 'react-native'
|
||||
import { AppState, LogBox, Platform } from 'react-native'
|
||||
import { enableScreens } from 'react-native-screens'
|
||||
import { QueryClient, QueryClientProvider } from 'react-query'
|
||||
import { Provider } from 'react-redux'
|
||||
@ -39,6 +40,17 @@ const App: React.FC = () => {
|
||||
log('log', 'App', 'rendering App')
|
||||
const [localCorrupt, setLocalCorrupt] = useState<string>()
|
||||
|
||||
useEffect(() => {
|
||||
AppState.addEventListener('change', () => {
|
||||
Notifications.setBadgeCountAsync(0)
|
||||
Notifications.dismissAllNotificationsAsync()
|
||||
})
|
||||
|
||||
return () => {
|
||||
AppState.removeEventListener('change', () => {})
|
||||
}
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
const delaySplash = async () => {
|
||||
log('log', 'App', 'delay splash')
|
||||
|
Reference in New Issue
Block a user