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')
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)
}
}, [])

View File

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

View File

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