From 80c09b588dbed95d1093a490c189649c9fb101a6 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Fri, 2 Mar 2018 11:22:37 +0000 Subject: [PATCH] MM-9647 Replaced usage of preventDoubleTap with wrapWithPreventDoubleTap (#1471) * MM-9467 Replaced usage of preventDoubleTap with wrapWithPreventDoubleTap * MM-9467 Renamed wrapWithPreventDoubleTap to preventDoubleTap --- .../channel_item/channel_item.js | 4 ++-- .../channel_drawer/channels_list/list/list.js | 8 +++---- .../switch_teams_button.js | 4 ++-- .../channel_drawer/teams_list/teams_list.js | 4 ++-- .../teams_list_item/teams_list_item.js | 4 ++-- app/components/channel_intro/channel_intro.js | 4 ++-- .../file_attachment_list.js | 6 ++--- .../markdown_code_block.js | 4 ++-- .../markdown/markdown_table/markdown_table.js | 4 ++-- .../markdown_table_image.js | 4 ++-- app/components/post/post.js | 24 +++++++++---------- .../settings_drawer/settings_drawer.js | 10 ++++---- .../interactive_action/interactive_action.js | 4 ++-- app/screens/channel/channel.js | 4 ++-- .../channel_nav_bar/channel_drawer_button.js | 4 ++-- .../channel_search_button.js | 4 ++-- .../channel_nav_bar/settings_drawer_button.js | 4 ++-- app/screens/channel_info/channel_info.js | 12 +++++----- app/screens/edit_profile/edit_profile.js | 4 ++-- app/screens/login/login.js | 4 ++-- app/screens/login_options/login_options.js | 12 +++++----- app/screens/mfa/mfa.js | 4 ++-- .../options_modal_list.android.js | 12 +++++++--- .../options_modal/options_modal_list.ios.js | 12 ++++++---- app/screens/search/search.js | 12 +++++----- app/screens/select_server/select_server.js | 4 ++-- app/screens/select_team/select_team.js | 2 +- .../advanced_settings/advanced_settings.js | 6 ++--- .../display_settings/display_settings.js | 4 ++-- app/screens/settings/general/settings.js | 18 +++++++------- .../notification_settings.js | 6 ++--- app/utils/tap.js | 14 +---------- 32 files changed, 112 insertions(+), 114 deletions(-) diff --git a/app/components/channel_drawer/channels_list/channel_item/channel_item.js b/app/components/channel_drawer/channels_list/channel_item/channel_item.js index cde499db0..798580cdf 100644 --- a/app/components/channel_drawer/channels_list/channel_item/channel_item.js +++ b/app/components/channel_drawer/channels_list/channel_item/channel_item.js @@ -14,7 +14,7 @@ import {intlShape} from 'react-intl'; import Badge from 'app/components/badge'; import ChannelIcon from 'app/components/channel_icon'; -import {wrapWithPreventDoubleTap} from 'app/utils/tap'; +import {preventDoubleTap} from 'app/utils/tap'; import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; const {View: AnimatedView} = Animated; @@ -40,7 +40,7 @@ export default class ChannelItem extends PureComponent { intl: intlShape, }; - onPress = wrapWithPreventDoubleTap(() => { + onPress = preventDoubleTap(() => { const {channelId, currentChannelId, displayName, fake, onSelectChannel, type} = this.props; requestAnimationFrame(() => { onSelectChannel({id: channelId, display_name: displayName, fake, type}, currentChannelId); diff --git a/app/components/channel_drawer/channels_list/list/list.js b/app/components/channel_drawer/channels_list/list/list.js index 74879845c..c21e18c73 100644 --- a/app/components/channel_drawer/channels_list/list/list.js +++ b/app/components/channel_drawer/channels_list/list/list.js @@ -19,7 +19,7 @@ import {debounce} from 'mattermost-redux/actions/helpers'; import ChannelItem from 'app/components/channel_drawer/channels_list/channel_item'; import UnreadIndicator from 'app/components/channel_drawer/channels_list/unread_indicator'; import {ListTypes} from 'app/constants'; -import {wrapWithPreventDoubleTap} from 'app/utils/tap'; +import {preventDoubleTap} from 'app/utils/tap'; import {changeOpacity} from 'app/utils/theme'; const VIEWABILITY_CONFIG = { @@ -148,7 +148,7 @@ export default class List extends PureComponent { return sections; }; - goToCreatePrivateChannel = wrapWithPreventDoubleTap(() => { + goToCreatePrivateChannel = preventDoubleTap(() => { const {navigator, theme} = this.props; const {intl} = this.context; @@ -171,7 +171,7 @@ export default class List extends PureComponent { }); }); - goToDirectMessages = wrapWithPreventDoubleTap(() => { + goToDirectMessages = preventDoubleTap(() => { const {navigator, theme} = this.props; const {intl} = this.context; @@ -196,7 +196,7 @@ export default class List extends PureComponent { }); }); - goToMoreChannels = wrapWithPreventDoubleTap(() => { + goToMoreChannels = preventDoubleTap(() => { const {navigator, theme} = this.props; const {intl} = this.context; diff --git a/app/components/channel_drawer/channels_list/switch_teams_button/switch_teams_button.js b/app/components/channel_drawer/channels_list/switch_teams_button/switch_teams_button.js index 558c69f37..096825799 100644 --- a/app/components/channel_drawer/channels_list/switch_teams_button/switch_teams_button.js +++ b/app/components/channel_drawer/channels_list/switch_teams_button/switch_teams_button.js @@ -11,7 +11,7 @@ import { import AwesomeIcon from 'react-native-vector-icons/FontAwesome'; import Badge from 'app/components/badge'; -import {wrapWithPreventDoubleTap} from 'app/utils/tap'; +import {preventDoubleTap} from 'app/utils/tap'; import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; export default class SwitchTeamsButton extends React.PureComponent { @@ -25,7 +25,7 @@ export default class SwitchTeamsButton extends React.PureComponent { theme: PropTypes.object.isRequired, }; - showTeams = wrapWithPreventDoubleTap(() => { + showTeams = preventDoubleTap(() => { this.props.onShowTeams(); }); diff --git a/app/components/channel_drawer/teams_list/teams_list.js b/app/components/channel_drawer/teams_list/teams_list.js index 85441180b..8b8b8d715 100644 --- a/app/components/channel_drawer/teams_list/teams_list.js +++ b/app/components/channel_drawer/teams_list/teams_list.js @@ -16,7 +16,7 @@ import MaterialIcon from 'react-native-vector-icons/MaterialIcons'; import FormattedText from 'app/components/formatted_text'; import {ListTypes, ViewTypes} from 'app/constants'; -import {wrapWithPreventDoubleTap} from 'app/utils/tap'; +import {preventDoubleTap} from 'app/utils/tap'; import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; import tracker from 'app/utils/time_tracker'; @@ -64,7 +64,7 @@ class TeamsList extends PureComponent { }); }; - goToSelectTeam = wrapWithPreventDoubleTap(() => { + goToSelectTeam = preventDoubleTap(() => { const {currentUrl, intl, navigator, theme} = this.props; navigator.showModal({ diff --git a/app/components/channel_drawer/teams_list/teams_list_item/teams_list_item.js b/app/components/channel_drawer/teams_list/teams_list_item/teams_list_item.js index 2cc024fe9..fd5f19225 100644 --- a/app/components/channel_drawer/teams_list/teams_list_item/teams_list_item.js +++ b/app/components/channel_drawer/teams_list/teams_list_item/teams_list_item.js @@ -11,7 +11,7 @@ import { import IonIcon from 'react-native-vector-icons/Ionicons'; import Badge from 'app/components/badge'; -import {wrapWithPreventDoubleTap} from 'app/utils/tap'; +import {preventDoubleTap} from 'app/utils/tap'; import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; export default class TeamsListItem extends React.PureComponent { @@ -26,7 +26,7 @@ export default class TeamsListItem extends React.PureComponent { theme: PropTypes.object.isRequired, }; - selectTeam = wrapWithPreventDoubleTap(() => { + selectTeam = preventDoubleTap(() => { this.props.selectTeam(this.props.teamId); }); diff --git a/app/components/channel_intro/channel_intro.js b/app/components/channel_intro/channel_intro.js index 5f8f2d8b4..a0eb1ee53 100644 --- a/app/components/channel_intro/channel_intro.js +++ b/app/components/channel_intro/channel_intro.js @@ -69,7 +69,7 @@ class ChannelIntro extends PureComponent { return currentChannelMembers.map((member) => ( preventDoubleTap(this.goToUserProfile, this, member.id)} + onPress={preventDoubleTap(() => this.goToUserProfile(member.id))} style={style.profile} > ( preventDoubleTap(this.goToUserProfile, this, member.id)} + onPress={preventDoubleTap(() => this.goToUserProfile(member.id))} > {index === currentChannelMembers.length - 1 ? this.getDisplayName(member) : `${this.getDisplayName(member)}, `} diff --git a/app/components/file_attachment_list/file_attachment_list.js b/app/components/file_attachment_list/file_attachment_list.js index ba550b851..f59f85653 100644 --- a/app/components/file_attachment_list/file_attachment_list.js +++ b/app/components/file_attachment_list/file_attachment_list.js @@ -69,11 +69,11 @@ export default class FileAttachmentList extends Component { this.props.onPress(); }; - handlePreviewPress = (file) => { + handlePreviewPress = preventDoubleTap((file) => { this.props.hideOptionsContext(); Keyboard.dismiss(); - preventDoubleTap(this.goToImagePreview, this, this.props.postId, file.id); - }; + this.goToImagePreview(this.props.postId, file.id); + }); handlePressIn = () => { this.props.toggleSelected(true); diff --git a/app/components/markdown/markdown_code_block/markdown_code_block.js b/app/components/markdown/markdown_code_block/markdown_code_block.js index bcc2da9c5..cf44657e9 100644 --- a/app/components/markdown/markdown_code_block/markdown_code_block.js +++ b/app/components/markdown/markdown_code_block/markdown_code_block.js @@ -15,7 +15,7 @@ import { import CustomPropTypes from 'app/constants/custom_prop_types'; import FormattedText from 'app/components/formatted_text'; import {getDisplayNameForLanguage} from 'app/utils/markdown'; -import {wrapWithPreventDoubleTap} from 'app/utils/tap'; +import {preventDoubleTap} from 'app/utils/tap'; import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; import mattermostManaged from 'app/mattermost_managed'; @@ -36,7 +36,7 @@ class MarkdownCodeBlock extends React.PureComponent { language: '', }; - handlePress = wrapWithPreventDoubleTap(() => { + handlePress = preventDoubleTap(() => { const {intl, navigator, theme} = this.props; const languageDisplayName = getDisplayNameForLanguage(this.props.language); diff --git a/app/components/markdown/markdown_table/markdown_table.js b/app/components/markdown/markdown_table/markdown_table.js index f1c6aa90e..bfa21faaa 100644 --- a/app/components/markdown/markdown_table/markdown_table.js +++ b/app/components/markdown/markdown_table/markdown_table.js @@ -11,7 +11,7 @@ import { } from 'react-native'; import LinearGradient from 'react-native-linear-gradient'; -import {wrapWithPreventDoubleTap} from 'app/utils/tap'; +import {preventDoubleTap} from 'app/utils/tap'; import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; const MAX_HEIGHT = 120; @@ -35,7 +35,7 @@ export default class MarkdownTable extends React.PureComponent { }; } - handlePress = wrapWithPreventDoubleTap(() => { + handlePress = preventDoubleTap(() => { const {navigator, theme} = this.props; navigator.push({ diff --git a/app/components/markdown/markdown_table_image/markdown_table_image.js b/app/components/markdown/markdown_table_image/markdown_table_image.js index 0b50500fe..858bd733a 100644 --- a/app/components/markdown/markdown_table_image/markdown_table_image.js +++ b/app/components/markdown/markdown_table_image/markdown_table_image.js @@ -7,7 +7,7 @@ import {intlShape} from 'react-intl'; import {Text} from 'react-native'; import CustomPropTypes from 'app/constants/custom_prop_types'; -import {wrapWithPreventDoubleTap} from 'app/utils/tap'; +import {preventDoubleTap} from 'app/utils/tap'; export default class MarkdownTableImage extends React.PureComponent { static propTypes = { @@ -23,7 +23,7 @@ export default class MarkdownTableImage extends React.PureComponent { intl: intlShape.isRequired, }; - handlePress = wrapWithPreventDoubleTap(() => { + handlePress = preventDoubleTap(() => { const {navigator, theme} = this.props; navigator.push({ diff --git a/app/components/post/post.js b/app/components/post/post.js index 10cce4d2a..2d472b118 100644 --- a/app/components/post/post.js +++ b/app/components/post/post.js @@ -17,7 +17,7 @@ import PostHeader from 'app/components/post_header'; import PostProfilePicture from 'app/components/post_profile_picture'; import {NavigationTypes} from 'app/constants'; import {emptyFunction} from 'app/utils/general'; -import {preventDoubleTap, wrapWithPreventDoubleTap} from 'app/utils/tap'; +import {preventDoubleTap} from 'app/utils/tap'; import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; import {getToolTipVisible} from 'app/utils/tooltip'; @@ -184,7 +184,7 @@ class Post extends PureComponent { this.props.actions.addReaction(post.id, emoji); } - handleAddReaction = wrapWithPreventDoubleTap(() => { + handleAddReaction = preventDoubleTap(() => { const {intl, navigator, post, theme} = this.props; MaterialIcon.getImageSource('close', 20, theme.sidebarHeaderTextColor). @@ -258,7 +258,7 @@ class Post extends PureComponent { }); }; - handlePress = () => { + handlePress = preventDoubleTap(() => { const { isSearchResult, onPress, @@ -267,21 +267,21 @@ class Post extends PureComponent { if (!getToolTipVisible()) { if (onPress && post.state !== Posts.POST_DELETED && !isSystemMessage(post) && !isPostPendingOrFailed(post)) { - preventDoubleTap(onPress, null, post); + onPress(post); } else if (!isSearchResult && isPostEphemeral(post)) { - preventDoubleTap(this.onRemovePost, this, post); + this.onRemovePost(post); } } - }; + }); - handleReply = () => { + handleReply = preventDoubleTap(() => { const {post, onReply} = this.props; if (!getToolTipVisible() && onReply) { - return preventDoubleTap(onReply, null, post); + return onReply(post); } return this.handlePress(); - }; + }); onRemovePost = (post) => { const {removePost} = this.props.actions; @@ -319,13 +319,13 @@ class Post extends PureComponent { return ; }; - viewUserProfile = () => { + viewUserProfile = preventDoubleTap(() => { const {isSearchResult} = this.props; if (!isSearchResult && !getToolTipVisible()) { - preventDoubleTap(this.goToUserProfile, this); + this.goToUserProfile(); } - }; + }); toggleSelected = (selected) => { if (!getToolTipVisible()) { diff --git a/app/components/settings_drawer/settings_drawer.js b/app/components/settings_drawer/settings_drawer.js index e0925279d..f9cce998b 100644 --- a/app/components/settings_drawer/settings_drawer.js +++ b/app/components/settings_drawer/settings_drawer.js @@ -21,7 +21,7 @@ import SafeAreaView from 'app/components/safe_area_view'; import Drawer from 'app/components/drawer'; import UserStatus from 'app/components/user_status'; import {NavigationTypes} from 'app/constants'; -import {wrapWithPreventDoubleTap} from 'app/utils/tap'; +import {preventDoubleTap} from 'app/utils/tap'; import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; import DrawerItem from './drawer_item'; @@ -135,7 +135,7 @@ export default class SettingsDrawer extends PureComponent { } }; - handleSetStatus = wrapWithPreventDoubleTap(() => { + handleSetStatus = preventDoubleTap(() => { const items = [{ action: () => this.setStatus(General.ONLINE), text: { @@ -179,7 +179,7 @@ export default class SettingsDrawer extends PureComponent { }); }); - goToEditProfile = wrapWithPreventDoubleTap(() => { + goToEditProfile = preventDoubleTap(() => { const {currentUser, navigator, theme} = this.props; const {formatMessage} = this.context.intl; @@ -208,7 +208,7 @@ export default class SettingsDrawer extends PureComponent { }); }); - goToSettings = wrapWithPreventDoubleTap(() => { + goToSettings = preventDoubleTap(() => { const {intl} = this.context; const {navigator, theme} = this.props; @@ -234,7 +234,7 @@ export default class SettingsDrawer extends PureComponent { }); }); - logout = wrapWithPreventDoubleTap(() => { + logout = preventDoubleTap(() => { const {logout} = this.props.actions; this.closeSettingsDrawer(); InteractionManager.runAfterInteractions(logout); diff --git a/app/components/slack_attachments/interactive_action/interactive_action.js b/app/components/slack_attachments/interactive_action/interactive_action.js index 8e27436a3..9d258f98b 100644 --- a/app/components/slack_attachments/interactive_action/interactive_action.js +++ b/app/components/slack_attachments/interactive_action/interactive_action.js @@ -6,7 +6,7 @@ import {Text} from 'react-native'; import PropTypes from 'prop-types'; import Button from 'react-native-button'; -import {wrapWithPreventDoubleTap} from 'app/utils/tap'; +import {preventDoubleTap} from 'app/utils/tap'; import {makeStyleSheetFromTheme} from 'app/utils/theme'; export default class InteractiveAction extends PureComponent { @@ -20,7 +20,7 @@ export default class InteractiveAction extends PureComponent { theme: PropTypes.object.isRequired, }; - handleActionPress = wrapWithPreventDoubleTap(() => { + handleActionPress = preventDoubleTap(() => { const {actions, id, postId} = this.props; actions.doPostAction(postId, id); }); diff --git a/app/screens/channel/channel.js b/app/screens/channel/channel.js index 891a91de1..b7c908070 100644 --- a/app/screens/channel/channel.js +++ b/app/screens/channel/channel.js @@ -21,7 +21,7 @@ import OfflineIndicator from 'app/components/offline_indicator'; import PostListRetry from 'app/components/post_list_retry'; import SafeAreaView from 'app/components/safe_area_view'; import StatusBar from 'app/components/status_bar'; -import {wrapWithPreventDoubleTap} from 'app/utils/tap'; +import {preventDoubleTap} from 'app/utils/tap'; import {makeStyleSheetFromTheme} from 'app/utils/theme'; import PostTextbox from 'app/components/post_textbox'; import networkConnectionListener from 'app/utils/network'; @@ -119,7 +119,7 @@ class Channel extends PureComponent { } }; - goToChannelInfo = wrapWithPreventDoubleTap(() => { + goToChannelInfo = preventDoubleTap(() => { const {intl, navigator, theme} = this.props; const options = { screen: 'ChannelInfo', diff --git a/app/screens/channel/channel_nav_bar/channel_drawer_button.js b/app/screens/channel/channel_nav_bar/channel_drawer_button.js index 6535cc6f8..ff9ddbf85 100644 --- a/app/screens/channel/channel_nav_bar/channel_drawer_button.js +++ b/app/screens/channel/channel_nav_bar/channel_drawer_button.js @@ -16,7 +16,7 @@ import Icon from 'react-native-vector-icons/Ionicons'; import Badge from 'app/components/badge'; import PushNotifications from 'app/push_notifications'; import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; -import {wrapWithPreventDoubleTap} from 'app/utils/tap'; +import {preventDoubleTap} from 'app/utils/tap'; import {makeStyleSheetFromTheme} from 'app/utils/theme'; import {getUnreadsInCurrentTeam} from 'mattermost-redux/selectors/entities/channels'; @@ -75,7 +75,7 @@ class ChannelDrawerButton extends PureComponent { this.setState({opacity: value > 0 ? 0.1 : 1}); }; - handlePress = wrapWithPreventDoubleTap(() => { + handlePress = preventDoubleTap(() => { this.props.openDrawer(); }); diff --git a/app/screens/channel/channel_nav_bar/channel_search_button/channel_search_button.js b/app/screens/channel/channel_nav_bar/channel_search_button/channel_search_button.js index 55db53b6b..c6c1c714f 100644 --- a/app/screens/channel/channel_nav_bar/channel_search_button/channel_search_button.js +++ b/app/screens/channel/channel_nav_bar/channel_search_button/channel_search_button.js @@ -12,7 +12,7 @@ import { } from 'react-native'; import AwesomeIcon from 'react-native-vector-icons/FontAwesome'; -import {wrapWithPreventDoubleTap} from 'app/utils/tap'; +import {preventDoubleTap} from 'app/utils/tap'; import {makeStyleSheetFromTheme} from 'app/utils/theme'; const SEARCH = 'search'; @@ -27,7 +27,7 @@ export default class ChannelSearchButton extends PureComponent { theme: PropTypes.object, }; - handlePress = wrapWithPreventDoubleTap(async () => { + handlePress = preventDoubleTap(async () => { const {actions, navigator, theme} = this.props; await actions.clearSearch(); diff --git a/app/screens/channel/channel_nav_bar/settings_drawer_button.js b/app/screens/channel/channel_nav_bar/settings_drawer_button.js index aea0b9c90..ae2d8d9ce 100644 --- a/app/screens/channel/channel_nav_bar/settings_drawer_button.js +++ b/app/screens/channel/channel_nav_bar/settings_drawer_button.js @@ -12,7 +12,7 @@ import { import Icon from 'react-native-vector-icons/Ionicons'; import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; -import {wrapWithPreventDoubleTap} from 'app/utils/tap'; +import {preventDoubleTap} from 'app/utils/tap'; import {makeStyleSheetFromTheme} from 'app/utils/theme'; class SettingDrawerButton extends PureComponent { @@ -25,7 +25,7 @@ class SettingDrawerButton extends PureComponent { theme: {}, }; - handlePress = wrapWithPreventDoubleTap(() => { + handlePress = preventDoubleTap(() => { this.props.openDrawer(); }); diff --git a/app/screens/channel_info/channel_info.js b/app/screens/channel_info/channel_info.js index 93de3b18d..5ff70f47a 100644 --- a/app/screens/channel_info/channel_info.js +++ b/app/screens/channel_info/channel_info.js @@ -12,7 +12,7 @@ import { } from 'react-native'; import StatusBar from 'app/components/status_bar'; -import {wrapWithPreventDoubleTap} from 'app/utils/tap'; +import {preventDoubleTap} from 'app/utils/tap'; import {alertErrorWithFallback} from 'app/utils/general'; import {changeOpacity, makeStyleSheetFromTheme, setNavigatorStyles} from 'app/utils/theme'; @@ -81,7 +81,7 @@ class ChannelInfo extends PureComponent { } }; - goToChannelAddMembers = wrapWithPreventDoubleTap(() => { + goToChannelAddMembers = preventDoubleTap(() => { const {intl, navigator, theme} = this.props; navigator.push({ backButtonTitle: '', @@ -97,7 +97,7 @@ class ChannelInfo extends PureComponent { }); }); - goToChannelMembers = wrapWithPreventDoubleTap(() => { + goToChannelMembers = preventDoubleTap(() => { const {canManageUsers, intl, navigator, theme} = this.props; const id = canManageUsers ? 'channel_header.manageMembers' : 'channel_header.viewMembers'; const defaultMessage = canManageUsers ? 'Manage Members' : 'View Members'; @@ -116,7 +116,7 @@ class ChannelInfo extends PureComponent { }); }); - handleChannelEdit = wrapWithPreventDoubleTap(() => { + handleChannelEdit = preventDoubleTap(() => { const {intl, navigator, theme} = this.props; const id = 'mobile.channel_info.edit'; const defaultMessage = 'Edit Channel'; @@ -143,7 +143,7 @@ class ChannelInfo extends PureComponent { this.handleDeleteOrLeave('delete'); }; - handleDeleteOrLeave = wrapWithPreventDoubleTap((eventType) => { + handleDeleteOrLeave = preventDoubleTap((eventType) => { const {formatMessage} = this.props.intl; const channel = this.props.currentChannel; const term = channel.type === General.OPEN_CHANNEL ? @@ -207,7 +207,7 @@ class ChannelInfo extends PureComponent { ); }); - handleClose = wrapWithPreventDoubleTap(() => { + handleClose = preventDoubleTap(() => { const {currentChannel, isCurrent, isFavorite} = this.props; const channel = Object.assign({}, currentChannel, {isCurrent}, {isFavorite}); const {closeDMChannel, closeGMChannel} = this.props.actions; diff --git a/app/screens/edit_profile/edit_profile.js b/app/screens/edit_profile/edit_profile.js index 7d2aabbb1..0d99f4f45 100644 --- a/app/screens/edit_profile/edit_profile.js +++ b/app/screens/edit_profile/edit_profile.js @@ -14,7 +14,7 @@ import StatusBar from 'app/components/status_bar/index'; import ProfilePicture from 'app/components/profile_picture/index'; import AttachmentButton from 'app/components/attachment_button'; import {emptyFunction} from 'app/utils/general'; -import {wrapWithPreventDoubleTap} from 'app/utils/tap'; +import {preventDoubleTap} from 'app/utils/tap'; import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; import EditProfileItem from './edit_profile_item'; @@ -142,7 +142,7 @@ export default class EditProfile extends PureComponent { } }; - submitUser = wrapWithPreventDoubleTap(async () => { + submitUser = preventDoubleTap(async () => { this.emitCanUpdateAccount(false); this.setState({error: null, updating: true}); diff --git a/app/screens/login/login.js b/app/screens/login/login.js index 98a11212a..725e0cbff 100644 --- a/app/screens/login/login.js +++ b/app/screens/login/login.js @@ -24,7 +24,7 @@ import FormattedText from 'app/components/formatted_text'; import StatusBar from 'app/components/status_bar'; import PushNotifications from 'app/push_notifications'; import {GlobalStyles} from 'app/styles'; -import {wrapWithPreventDoubleTap} from 'app/utils/tap'; +import {preventDoubleTap} from 'app/utils/tap'; import tracker from 'app/utils/time_tracker'; import logo from 'assets/images/logo.png'; @@ -134,7 +134,7 @@ class Login extends PureComponent { Keyboard.dismiss(); }; - preSignIn = wrapWithPreventDoubleTap(() => { + preSignIn = preventDoubleTap(() => { this.setState({error: null, isLoading: true}); Keyboard.dismiss(); InteractionManager.runAfterInteractions(async () => { diff --git a/app/screens/login_options/login_options.js b/app/screens/login_options/login_options.js index c1160c320..9d8d96603 100644 --- a/app/screens/login_options/login_options.js +++ b/app/screens/login_options/login_options.js @@ -40,7 +40,7 @@ class LoginOptions extends PureComponent { Orientation.removeOrientationListener(this.orientationDidChange); } - goToLogin = () => { + goToLogin = preventDoubleTap(() => { const {intl, navigator, theme} = this.props; navigator.push({ screen: 'Login', @@ -54,7 +54,7 @@ class LoginOptions extends PureComponent { screenBackgroundColor: theme.centerChannelBg, }, }); - }; + }); goToSSO = (ssoType) => { const {intl, navigator, theme} = this.props; @@ -98,7 +98,7 @@ class LoginOptions extends PureComponent { return (