From 43b582d4e5d03a1b11dd0b5737b0c4c53eb83107 Mon Sep 17 00:00:00 2001 From: enahum Date: Sun, 26 Mar 2017 22:22:26 -0300 Subject: [PATCH] Fix new line indicator for center channel & thread (#394) --- app/scenes/channel_drawer/channel_drawer.js | 2 +- app/scenes/thread/thread.js | 16 +++++++++++++++- app/scenes/thread/thread_container.js | 2 ++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/scenes/channel_drawer/channel_drawer.js b/app/scenes/channel_drawer/channel_drawer.js index 0a108b879..641125b4c 100644 --- a/app/scenes/channel_drawer/channel_drawer.js +++ b/app/scenes/channel_drawer/channel_drawer.js @@ -32,7 +32,7 @@ export default class ChannelDrawer extends PureComponent { currentTeam } = this.props; - this.props.actions.markChannelAsRead(id, currentChannel.id); + this.props.actions.markChannelAsRead(currentChannel.id); this.props.actions.viewChannel(currentTeam.id, id); this.props.actions.closeDrawers(); InteractionManager.runAfterInteractions(() => { diff --git a/app/scenes/thread/thread.js b/app/scenes/thread/thread.js index 9ede59a92..14a5ab038 100644 --- a/app/scenes/thread/thread.js +++ b/app/scenes/thread/thread.js @@ -27,6 +27,7 @@ export default class Thread extends PureComponent { }).isRequired, teamId: PropTypes.string.isRequired, channelId: PropTypes.string.isRequired, + myMember: PropTypes.object.isRequired, files: PropTypes.array, rootId: PropTypes.string.isRequired, draft: PropTypes.string.isRequired, @@ -40,6 +41,14 @@ export default class Thread extends PureComponent { } }; + state = {}; + + componentWillReceiveProps(nextProps) { + if (!this.state.lastViewedAt) { + this.setState({lastViewedAt: nextProps.myMember.last_viewed_at}); + } + } + componentWillUnmount() { this.props.actions.selectPost(''); } @@ -58,7 +67,12 @@ export default class Thread extends PureComponent { keyboardVerticalOffset={65} > - +