Skip to content

Commit

Permalink
fix(mobile): do not send mutation when not needed
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 14, 2019
1 parent 796f513 commit a77da0f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions client/react-native/common/components/Screens/Chats/Detail.js
Expand Up @@ -24,9 +24,11 @@ class Message extends React.PureComponent {
static contextType = RelayContext

messageSeen = async () => {
await this.props.context.mutations.eventSeen({
id: this.props.data.id,
})
if (this.props.data.seenAt === null) {
await this.props.context.mutations.eventSeen({
id: this.props.data.id,
})
}
}

render () {
Expand Down

0 comments on commit a77da0f

Please sign in to comment.