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
No known key found for this signature in database
GPG Key ID: 078A93AB607D85E0
3 changed files with 10 additions and 12 deletions

View File

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

View File

@ -30,9 +30,9 @@ const ScreenMeSettingsPush: React.FC = () => {
} }
useEffect(() => { useEffect(() => {
checkPush() checkPush()
AppState.addEventListener('change', () => checkPush()) AppState.addEventListener('change', checkPush)
return () => { return () => {
AppState.removeEventListener('change', () => checkPush()) AppState.removeEventListener('change', checkPush)
} }
}, []) }, [])

View File

@ -26,7 +26,7 @@ const AccountInformationStats: React.FC<Props> = ({ account, myInfo }) => {
<Text <Text
style={[styles.stat, { color: theme.primary }]} style={[styles.stat, { color: theme.primary }]}
children={t('content.summary.statuses_count', { children={t('content.summary.statuses_count', {
count: account?.statuses_count || 0 count: account.statuses_count || 0
})} })}
onPress={() => { onPress={() => {
analytics('account_stats_toots_press', { analytics('account_stats_toots_press', {
@ -48,7 +48,7 @@ const AccountInformationStats: React.FC<Props> = ({ account, myInfo }) => {
<Text <Text
style={[styles.stat, { color: theme.primary, textAlign: 'right' }]} style={[styles.stat, { color: theme.primary, textAlign: 'right' }]}
children={t('content.summary.following_count', { children={t('content.summary.following_count', {
count: account?.following_count || 0 count: account.following_count || 0
})} })}
onPress={() => { onPress={() => {
analytics('account_stats_following_press', { analytics('account_stats_following_press', {