1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Minor fixes according to DeepScan

GitHub actions'a Mac is without connectivity again..
This commit is contained in:
Zhiyuan Zheng
2021-03-09 01:24:33 +01:00
parent e1e4aace78
commit 4afdaf84c1
3 changed files with 10 additions and 12 deletions

View File

@ -40,17 +40,15 @@ const App: React.FC = () => {
log('log', 'App', 'rendering App')
const [localCorrupt, setLocalCorrupt] = useState<string>()
const appStateEffect = useCallback(() => {
Notifications.setBadgeCountAsync(0)
Notifications.dismissAllNotificationsAsync()
}, [])
useEffect(() => {
AppState.addEventListener('change', () => {
Notifications.setBadgeCountAsync(0)
Notifications.dismissAllNotificationsAsync()
})
AppState.addEventListener('change', appStateEffect)
return () => {
AppState.removeEventListener('change', () => {
Notifications.setBadgeCountAsync(0)
Notifications.dismissAllNotificationsAsync()
})
AppState.removeEventListener('change', appStateEffect)
}
}, [])