Skip to content

Commit

Permalink
fix: burger badge
Browse files Browse the repository at this point in the history
  • Loading branch information
tangimds committed Oct 6, 2021
1 parent e9739b4 commit 45d8323
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/components/Header.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, {useEffect, useState} from 'react';
import React, {useState} from 'react';
import {StyleSheet, View} from 'react-native';
import {colors} from '../utils/colors';
import Icon from './Icon';
import Text from './MyText';
import Settings from '../scenes/settings/settings-modal';
import Drawer from './drawer';
import {useRoute} from '@react-navigation/native';
import {useRoute, useFocusEffect} from '@react-navigation/native';
import {needUpdate} from '../services/versionChecker';
import {getBadgeNotesVersion} from '../scenes/news';
import localStorage from '../utils/localStorage';
Expand All @@ -24,9 +24,11 @@ const Header = ({title, navigation}) => {
setBadge(update || news || (supported === 'PRO' && !badgeProNPS));
};

useEffect(() => {
updateBadge();
}, [navigation]);
useFocusEffect(
React.useCallback(() => {
updateBadge();
}, []),
);

return (
<View style={styles.container}>
Expand Down

0 comments on commit 45d8323

Please sign in to comment.