diff --git a/app/components/network_indicator/network.tsx b/app/components/network_indicator/network.tsx index 765bde39c..348a575a0 100644 --- a/app/components/network_indicator/network.tsx +++ b/app/components/network_indicator/network.tsx @@ -193,7 +193,9 @@ const NetworkIndicator = ({ useEffect(() => { if (channelId) { - clearNotificationTimeout.current = setTimeout(clearNotifications, 1500); + clearNotificationTimeout.current = setTimeout(() => { + PushNotifications.clearChannelNotifications(channelId); + }, 1500); } return () => { diff --git a/app/screens/edit_post/edit_post.js b/app/screens/edit_post/edit_post.js index 08dc18809..44fb2d989 100644 --- a/app/screens/edit_post/edit_post.js +++ b/app/screens/edit_post/edit_post.js @@ -68,6 +68,7 @@ export default class EditPost extends PureComponent { this.rightButton.color = props.theme.sidebarHeaderTextColor; this.rightButton.text = context.intl.formatMessage({id: 'edit_post.save', defaultMessage: 'Save'}); + this.rightButtonEnabled = true; setButtons(props.componentId, { leftButtons: [{...this.leftButton, icon: props.closeButton}], @@ -99,14 +100,18 @@ export default class EditPost extends PureComponent { emitCanEditPost = (enabled) => { const {componentId} = this.props; - setButtons(componentId, { - leftButtons: [{...this.leftButton, icon: this.props.closeButton}], - rightButtons: [{...this.rightButton, enabled}], - }); + if (this.rightButtonEnabled !== enabled) { + this.rightButtonEnabled = enabled; + setButtons(componentId, { + leftButtons: [{...this.leftButton, icon: this.props.closeButton}], + rightButtons: [{...this.rightButton, enabled}], + }); + } }; emitEditing = (loading) => { const {componentId} = this.props; + this.rightButtonEnabled = !loading; setButtons(componentId, { leftButtons: [{...this.leftButton, icon: this.props.closeButton}], rightButtons: [{...this.rightButton, enabled: !loading}],