forked from Ivasoft/mattermost-mobile
Fix typing on input box after returning from an archived channel (#3995)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
This commit is contained in:
@@ -318,7 +318,6 @@ export function selectPenultimateChannel(teamId) {
|
|||||||
lastChannel.delete_at === 0 &&
|
lastChannel.delete_at === 0 &&
|
||||||
(lastChannel.team_id === teamId || isDMVisible || isGMVisible)
|
(lastChannel.team_id === teamId || isDMVisible || isGMVisible)
|
||||||
) {
|
) {
|
||||||
dispatch(setChannelLoading(true));
|
|
||||||
dispatch(handleSelectChannel(lastChannelId));
|
dispatch(handleSelectChannel(lastChannelId));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ function mapStateToProps(state, ownProps) {
|
|||||||
channelTeamId: currentChannel ? currentChannel.team_id : '',
|
channelTeamId: currentChannel ? currentChannel.team_id : '',
|
||||||
canUploadFiles: canUploadFilesOnMobile(state),
|
canUploadFiles: canUploadFilesOnMobile(state),
|
||||||
channelDisplayName: state.views.channel.displayName || (currentChannel ? currentChannel.display_name : ''),
|
channelDisplayName: state.views.channel.displayName || (currentChannel ? currentChannel.display_name : ''),
|
||||||
channelIsLoading: state.views.channel.loading,
|
|
||||||
channelIsReadOnly: isCurrentChannelReadOnly(state) || false,
|
channelIsReadOnly: isCurrentChannelReadOnly(state) || false,
|
||||||
channelIsArchived: ownProps.channelIsArchived || (currentChannel ? currentChannel.delete_at !== 0 : false),
|
channelIsArchived: ownProps.channelIsArchived || (currentChannel ? currentChannel.delete_at !== 0 : false),
|
||||||
currentUserId,
|
currentUserId,
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ describe('PostTextBox', () => {
|
|||||||
channelId: 'channel-id',
|
channelId: 'channel-id',
|
||||||
channelDisplayName: 'Test Channel',
|
channelDisplayName: 'Test Channel',
|
||||||
channelTeamId: 'channel-team-id',
|
channelTeamId: 'channel-team-id',
|
||||||
channelIsLoading: false,
|
|
||||||
channelIsReadOnly: false,
|
channelIsReadOnly: false,
|
||||||
currentUserId: 'current-user-id',
|
currentUserId: 'current-user-id',
|
||||||
deactivatedChannel: false,
|
deactivatedChannel: false,
|
||||||
|
|||||||
@@ -74,7 +74,6 @@ export default class PostTextBoxBase extends PureComponent {
|
|||||||
channelId: PropTypes.string.isRequired,
|
channelId: PropTypes.string.isRequired,
|
||||||
channelDisplayName: PropTypes.string,
|
channelDisplayName: PropTypes.string,
|
||||||
channelTeamId: PropTypes.string.isRequired,
|
channelTeamId: PropTypes.string.isRequired,
|
||||||
channelIsLoading: PropTypes.bool,
|
|
||||||
channelIsReadOnly: PropTypes.bool.isRequired,
|
channelIsReadOnly: PropTypes.bool.isRequired,
|
||||||
currentUserId: PropTypes.string.isRequired,
|
currentUserId: PropTypes.string.isRequired,
|
||||||
deactivatedChannel: PropTypes.bool.isRequired,
|
deactivatedChannel: PropTypes.bool.isRequired,
|
||||||
@@ -871,7 +870,7 @@ export default class PostTextBoxBase extends PureComponent {
|
|||||||
|
|
||||||
renderTextBox = () => {
|
renderTextBox = () => {
|
||||||
const {intl} = this.context;
|
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);
|
const style = getStyleSheet(theme);
|
||||||
|
|
||||||
if (channelIsArchived) {
|
if (channelIsArchived) {
|
||||||
@@ -879,7 +878,6 @@ export default class PostTextBoxBase extends PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const {value, extraInputPadding} = this.state;
|
const {value, extraInputPadding} = this.state;
|
||||||
const textValue = channelIsLoading ? '' : value;
|
|
||||||
const placeholder = this.getPlaceHolder();
|
const placeholder = this.getPlaceHolder();
|
||||||
|
|
||||||
let maxHeight = 150;
|
let maxHeight = 150;
|
||||||
@@ -912,7 +910,7 @@ export default class PostTextBoxBase extends PureComponent {
|
|||||||
>
|
>
|
||||||
<PasteableTextInput
|
<PasteableTextInput
|
||||||
ref={this.input}
|
ref={this.input}
|
||||||
value={textValue}
|
value={value}
|
||||||
style={{...style.input, ...inputStyle, maxHeight}}
|
style={{...style.input, ...inputStyle, maxHeight}}
|
||||||
onChangeText={this.handleTextChange}
|
onChangeText={this.handleTextChange}
|
||||||
onSelectionChange={this.handlePostDraftSelectionChanged}
|
onSelectionChange={this.handlePostDraftSelectionChanged}
|
||||||
|
|||||||
Reference in New Issue
Block a user