From 6f53f9be169f90ef78e41ba283ea3356cd896cc1 Mon Sep 17 00:00:00 2001 From: Mattermost Build Date: Wed, 4 Mar 2020 00:27:06 +0100 Subject: [PATCH] Fix typing on input box after returning from an archived channel (#3995) Co-authored-by: Elias Nahum --- app/actions/views/channel.js | 1 - app/components/post_textbox/index.js | 1 - app/components/post_textbox/post_textbox.test.js | 1 - app/components/post_textbox/post_textbox_base.js | 6 ++---- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/app/actions/views/channel.js b/app/actions/views/channel.js index 0254062cb..a297e4bce 100644 --- a/app/actions/views/channel.js +++ b/app/actions/views/channel.js @@ -318,7 +318,6 @@ export function selectPenultimateChannel(teamId) { lastChannel.delete_at === 0 && (lastChannel.team_id === teamId || isDMVisible || isGMVisible) ) { - dispatch(setChannelLoading(true)); dispatch(handleSelectChannel(lastChannelId)); return; } diff --git a/app/components/post_textbox/index.js b/app/components/post_textbox/index.js index ac0878ab0..50e10a23d 100644 --- a/app/components/post_textbox/index.js +++ b/app/components/post_textbox/index.js @@ -55,7 +55,6 @@ function mapStateToProps(state, ownProps) { channelTeamId: currentChannel ? currentChannel.team_id : '', canUploadFiles: canUploadFilesOnMobile(state), channelDisplayName: state.views.channel.displayName || (currentChannel ? currentChannel.display_name : ''), - channelIsLoading: state.views.channel.loading, channelIsReadOnly: isCurrentChannelReadOnly(state) || false, channelIsArchived: ownProps.channelIsArchived || (currentChannel ? currentChannel.delete_at !== 0 : false), currentUserId, diff --git a/app/components/post_textbox/post_textbox.test.js b/app/components/post_textbox/post_textbox.test.js index aff9d8601..4ee2ba1f6 100644 --- a/app/components/post_textbox/post_textbox.test.js +++ b/app/components/post_textbox/post_textbox.test.js @@ -46,7 +46,6 @@ describe('PostTextBox', () => { channelId: 'channel-id', channelDisplayName: 'Test Channel', channelTeamId: 'channel-team-id', - channelIsLoading: false, channelIsReadOnly: false, currentUserId: 'current-user-id', deactivatedChannel: false, diff --git a/app/components/post_textbox/post_textbox_base.js b/app/components/post_textbox/post_textbox_base.js index 1b885b020..70388c131 100644 --- a/app/components/post_textbox/post_textbox_base.js +++ b/app/components/post_textbox/post_textbox_base.js @@ -74,7 +74,6 @@ export default class PostTextBoxBase extends PureComponent { channelId: PropTypes.string.isRequired, channelDisplayName: PropTypes.string, channelTeamId: PropTypes.string.isRequired, - channelIsLoading: PropTypes.bool, channelIsReadOnly: PropTypes.bool.isRequired, currentUserId: PropTypes.string.isRequired, deactivatedChannel: PropTypes.bool.isRequired, @@ -871,7 +870,7 @@ export default class PostTextBoxBase extends PureComponent { renderTextBox = () => { const {intl} = this.context; - const {channelDisplayName, channelIsArchived, channelIsLoading, channelIsReadOnly, theme, isLandscape, files, rootId} = this.props; + const {channelDisplayName, channelIsArchived, channelIsReadOnly, theme, isLandscape, files, rootId} = this.props; const style = getStyleSheet(theme); if (channelIsArchived) { @@ -879,7 +878,6 @@ export default class PostTextBoxBase extends PureComponent { } const {value, extraInputPadding} = this.state; - const textValue = channelIsLoading ? '' : value; const placeholder = this.getPlaceHolder(); let maxHeight = 150; @@ -912,7 +910,7 @@ export default class PostTextBoxBase extends PureComponent { >