This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 827
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The previous dispatch only did binary muted/non-muted but we now have 4 states. We now just listen for the push rules account data and update on that so it stays in sync if the pishrules are changed elsewhere. Also add util functions used here for getting the notif state and in vector for both getting and setting it.
As it now incorrectly represents the mute as a binary toggle rather than a quad-state
@@ -179,15 +184,18 @@ module.exports = React.createClass({ | |||
var notificationCount = this.props.room.getUnreadNotificationCount(); | |||
// var highlightCount = this.props.room.getUnreadNotificationCount("highlight"); | |||
|
|||
var badges = notificationCount > 0 && this._shouldShowNotifBadge(); | |||
badges |= this.props.highlight && this._shouldShowMentionBadge(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a fan of the use of bitwise |
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about factoring out the sub-clauses to local vars?
@@ -18,12 +18,19 @@ import MatrixClientPeg from './MatrixClientPeg'; | |||
import PushProcessor from 'matrix-js-sdk/lib/pushprocessor'; | |||
import q from 'q'; | |||
|
|||
export const ALL_MESSAGES_LOUD = 'all_messages_loud'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have gone for
export const NOTIFICATION_STATES = {
ALL_MESSAGES_LOUD: 'all_messages_loud',
...
}
but this is fine too
just some minor quibbling |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes notification toggle from binary everything/mentions-only to the 4 level slider. Also uses the push rule account data to update the state rather than an internal dispatch, so the state remains consistent if it's changed from a different client.
Also fixes element-hq/element-web#1495