Skip to content

Commit

Permalink
fix(mobile): fix badges road
Browse files Browse the repository at this point in the history
Signed-off-by: Sacha Froment <sfroment42@gmail.com>
  • Loading branch information
sfroment committed Mar 15, 2019
1 parent a77da0f commit afc93e0
Showing 1 changed file with 5 additions and 6 deletions.
Expand Up @@ -35,7 +35,7 @@ class TabBarIconBase extends Component {
shouldRefresh: false,
stored: [],
queryList: queries.EventList.graphql,
queryVariables: props.routeName === 'contacts'
queryVariables: props.routeName === 'contacts' || props.routeName === 'side/contacts'
? merge([queries.EventList.defaultVariables, {
filter: {
kind: 201,
Expand All @@ -49,7 +49,7 @@ class TabBarIconBase extends Component {
direction: 1,
},
}]),
subscription: props.routeName === 'contacts'
subscription: props.routeName === 'contacts' || props.routeName === 'side/contacts'
? [subscriptions.contactRequest]
: [subscriptions.message],
}
Expand All @@ -70,14 +70,13 @@ class TabBarIconBase extends Component {
const idx = stored.indexOf(id)

if (idx === -1 && seenAt === null) {
console.log('props.data', props.data)
this.setState({
stored: [
...stored,
id,
],
})
} else if (idx !== -1 && routeName === 'chats' && new Date(seenAt).getTime() > 0) {
} else if (idx !== -1 && (routeName === 'chats' || routeName === 'side/chats') && new Date(seenAt).getTime() > 0) {
stored.splice(stored.indexOf(id), 1)
this.setState({
stored,
Expand Down Expand Up @@ -127,11 +126,11 @@ class TabBarIconBase extends Component {
'side/settings': 'settings',
}[routeName]

if (routeName === 'contacts' && navigation.isFocused() === true) {
if ((routeName === 'contacts' || routeName === 'side/contacts') && navigation.isFocused() === true) {
this.contactSeen()
}

return routeName === 'settings'
return routeName === 'settings' || routeName === 'side/settings'
? (
<UpdateContext.Consumer>
{({ availableUpdate }) => (
Expand Down

0 comments on commit afc93e0

Please sign in to comment.