diff --git a/app/components/autocomplete/slash_suggestion/index.js b/app/components/autocomplete/slash_suggestion/index.js index 8a42f7046..ecf5e06df 100644 --- a/app/components/autocomplete/slash_suggestion/index.js +++ b/app/components/autocomplete/slash_suggestion/index.js @@ -29,7 +29,6 @@ const mobileCommandsSelector = createSelector( function mapStateToProps(state) { return { commands: mobileCommandsSelector(state), - commandsRequest: state.requests.integrations.getAutocompleteCommands, currentTeamId: getCurrentTeamId(state), theme: getTheme(state), isLandscape: isLandscape(state), diff --git a/app/components/autocomplete/slash_suggestion/slash_suggestion.js b/app/components/autocomplete/slash_suggestion/slash_suggestion.js index 8af8a3f4e..c16b80bf6 100644 --- a/app/components/autocomplete/slash_suggestion/slash_suggestion.js +++ b/app/components/autocomplete/slash_suggestion/slash_suggestion.js @@ -1,15 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {Component} from 'react'; +import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; import { FlatList, Platform, } from 'react-native'; -import {RequestStatus} from 'mattermost-redux/constants'; - import AutocompleteDivider from 'app/components/autocomplete/autocomplete_divider'; import {makeStyleSheetFromTheme} from 'app/utils/theme'; @@ -18,14 +16,13 @@ import SlashSuggestionItem from './slash_suggestion_item'; const SLASH_REGEX = /(^\/)([a-zA-Z-]*)$/; const TIME_BEFORE_NEXT_COMMAND_REQUEST = 1000 * 60 * 5; -export default class SlashSuggestion extends Component { +export default class SlashSuggestion extends PureComponent { static propTypes = { actions: PropTypes.shape({ getAutocompleteCommands: PropTypes.func.isRequired, }).isRequired, currentTeamId: PropTypes.string.isRequired, commands: PropTypes.array, - commandsRequest: PropTypes.object.isRequired, isSearch: PropTypes.bool, maxListHeight: PropTypes.number, theme: PropTypes.object.isRequired, @@ -56,7 +53,6 @@ export default class SlashSuggestion extends Component { const {currentTeamId} = this.props; const { commands: nextCommands, - commandsRequest: nextCommandsRequest, currentTeamId: nextTeamId, value: nextValue, } = nextProps; @@ -81,7 +77,7 @@ export default class SlashSuggestion extends Component { const dataIsStale = Date.now() - this.state.lastCommandRequest > TIME_BEFORE_NEXT_COMMAND_REQUEST; - if ((!nextCommands.length || dataIsStale) && nextCommandsRequest.status !== RequestStatus.STARTED) { + if ((!nextCommands.length || dataIsStale)) { this.props.actions.getAutocompleteCommands(nextProps.currentTeamId); this.setState({ lastCommandRequest: Date.now(), diff --git a/package-lock.json b/package-lock.json index 498113314..52a6b320f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mattermost-mobile", - "version": "1.27.0", + "version": "1.27.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 512fe12b6..41aed7a6f 100644 --- a/package.json +++ b/package.json @@ -155,4 +155,4 @@ "node_modules/(?!react-native|jail-monkey|@sentry/react-native|react-navigation|@react-native-community/cameraroll)" ] } -} \ No newline at end of file +}