prevent double tap on Channel Info options (#2455)

This commit is contained in:
Elias Nahum 2018-12-13 15:33:47 -03:00 committed by GitHub
parent e8d70616bb
commit 3b5e2e8a34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -292,13 +292,13 @@ export default class ChannelInfo extends PureComponent {
}
});
handleFavorite = () => {
handleFavorite = preventDoubleTap(() => {
const {isFavorite, actions, currentChannel} = this.props;
const {favoriteChannel, unfavoriteChannel} = actions;
const toggleFavorite = isFavorite ? unfavoriteChannel : favoriteChannel;
this.setState({isFavorite: !isFavorite});
toggleFavorite(currentChannel.id);
};
});
handleClosePermalink = () => {
const {actions} = this.props;
@ -311,7 +311,7 @@ export default class ChannelInfo extends PureComponent {
this.showPermalinkView(postId);
};
handleMuteChannel = () => {
handleMuteChannel = preventDoubleTap(() => {
const {actions, currentChannel, currentUserId, isChannelMuted} = this.props;
const {updateChannelNotifyProps} = actions;
const opts = {
@ -320,9 +320,9 @@ export default class ChannelInfo extends PureComponent {
this.setState({isMuted: !isChannelMuted});
updateChannelNotifyProps(currentUserId, currentChannel.id, opts);
};
});
handleIgnoreChannelMentions = () => {
handleIgnoreChannelMentions = preventDoubleTap(() => {
const {actions, currentChannel, currentUserId, ignoreChannelMentions} = this.props;
const {updateChannelNotifyProps} = actions;
@ -332,7 +332,7 @@ export default class ChannelInfo extends PureComponent {
this.setState({ignoreChannelMentions: !ignoreChannelMentions});
updateChannelNotifyProps(currentUserId, currentChannel.id, opts);
}
});
showPermalinkView = (postId) => {
const {actions, navigator} = this.props;