Mute state handled corrcectly

pull/1900/head
wmwragg 2016-07-28 17:25:28 +01:00
parent 49545ce0c2
commit 55a10ee275
2 changed files with 23 additions and 1 deletions

View File

@ -20,6 +20,7 @@ var q = require("q");
var React = require('react');
var classNames = require('classnames');
var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg');
var dis = require('matrix-react-sdk/lib/dispatcher');
module.exports = React.createClass({
displayName: 'NotificationStateContextMenu',
@ -59,7 +60,17 @@ module.exports = React.createClass({
self.setState({areNotifsMuted: isMuted});
// delay slightly so that the user can see their state change
// before closing the menu
q.delay(500).then(function() {
// tell everyone that wants to know of the change in
// notification state
dis.dispatch({
action: 'notification_change',
roomId: self.props.room.roomId,
isMuted: isMuted,
});
// Close the context menu
if (self.props.onFinished) {
self.props.onFinished();
};

View File

@ -22,6 +22,10 @@ limitations under the License.
display: block;
}
.mx_RoomTile .mx_RoomTile_mute {
opacity: 0.4;
}
.mx_RoomTile_avatar {
display: inline-block;
padding-top: 6px;
@ -121,11 +125,18 @@ limitations under the License.
padding-right: 4px;
}
.mx_RoomTile .mx_RoomTile_badge.mx_RoomTile_badgeButton, .mx_RoomTile.mx_RoomTile_menu .mx_RoomTile_badge {
.mx_RoomTile .mx_RoomTile_badge.mx_RoomTile_badgeButton, .mx_RoomTile .mx_RoomTile_badge.mx_RoomTile_badgeButton.mx_RoomTile_badgeMute, .mx_RoomTile.mx_RoomTile_menu .mx_RoomTile_badge, .mx_RoomTile .mx_RoomTile_badge.mx_RoomTile_badgeButton.mx_RoomTile_badgeMute {
background-color: rgb(214, 214, 214);
letter-spacing: 0.1em;
opacity: 1;
}
.mx_RoomTile .mx_RoomTile_badge.mx_RoomTile_badgeMute {
background-color: rgba(0,0,0,0);
opacity: 1;
top: 4px;
}
.mx_RoomTile_unreadNotify .mx_RoomTile_badge {
background-color: #76cfa6;
}