* MM-37840 do not mark channel as read when clearing push notifications
* MM-37841 prevent from setting the edit post screen buttons with every key press
(cherry picked from commit a44a19d125)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
This commit is contained in:
parent
4549ecdd94
commit
c0fb9aa4ba
2 changed files with 12 additions and 5 deletions
|
|
@ -193,7 +193,9 @@ const NetworkIndicator = ({
|
|||
|
||||
useEffect(() => {
|
||||
if (channelId) {
|
||||
clearNotificationTimeout.current = setTimeout(clearNotifications, 1500);
|
||||
clearNotificationTimeout.current = setTimeout(() => {
|
||||
PushNotifications.clearChannelNotifications(channelId);
|
||||
}, 1500);
|
||||
}
|
||||
|
||||
return () => {
|
||||
|
|
|
|||
|
|
@ -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}],
|
||||
|
|
|
|||
Loading…
Reference in a new issue