1
0
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:
Zhiyuan Zheng
2021-03-02 01:17:06 +01:00
parent 82cefdc80c
commit ea018a71fa
38 changed files with 417 additions and 218 deletions

View File

@ -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')