Fix typing on input box after returning from an archived channel (#3992)

This commit is contained in:
Elias Nahum 2020-03-03 19:44:23 -03:00 committed by GitHub
parent fbee2fb6b6
commit 58dcbb215b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 7 deletions

View file

@ -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;
}

View file

@ -68,7 +68,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,

View file

@ -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,

View file

@ -76,7 +76,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,
@ -898,7 +897,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) {
@ -906,7 +905,6 @@ export default class PostTextBoxBase extends PureComponent {
}
const {value, extraInputPadding} = this.state;
const textValue = channelIsLoading ? '' : value;
const placeholder = this.getPlaceHolder();
let maxHeight = 150;
@ -939,7 +937,7 @@ export default class PostTextBoxBase extends PureComponent {
>
<PasteableTextInput
ref={this.input}
value={textValue}
value={value}
style={{...style.input, ...inputStyle, maxHeight}}
onChangeText={this.handleTextChange}
onSelectionChange={this.handleOnSelectionChange}