Fix favicon/title badge count
This was using a separate function (in MatrixChat) that didn't take into account whether we were supposed to be hiding the badge for rooms so would include notifs that were hidden everywhere else. Also make it a function & put it in RoomNotifs with all its friends. Fixes https://github.com/vector-im/riot-web/issues/3060
This commit is contained in:
parent
9591e6b0d3
commit
edd43a2706
2 changed files with 23 additions and 13 deletions
|
@ -54,6 +54,7 @@ import ResizeNotifier from "../../utils/ResizeNotifier";
|
|||
import { ValidatedServerConfig } from "../../utils/AutoDiscoveryUtils";
|
||||
import AutoDiscoveryUtils from "../../utils/AutoDiscoveryUtils";
|
||||
import DMRoomMap from '../../utils/DMRoomMap';
|
||||
import { countRoomsWithNotif } from '../../RoomNotifs';
|
||||
|
||||
// Disable warnings for now: we use deprecated bluebird functions
|
||||
// and need to migrate, but they spam the console with warnings.
|
||||
|
@ -1749,19 +1750,7 @@ export default React.createClass({
|
|||
},
|
||||
|
||||
updateStatusIndicator: function(state, prevState) {
|
||||
let notifCount = 0;
|
||||
|
||||
const rooms = MatrixClientPeg.get().getRooms();
|
||||
for (let i = 0; i < rooms.length; ++i) {
|
||||
if (rooms[i].hasMembershipState(MatrixClientPeg.get().credentials.userId, 'invite')) {
|
||||
notifCount++;
|
||||
} else if (rooms[i].getUnreadNotificationCount()) {
|
||||
// if we were summing unread notifs:
|
||||
// notifCount += rooms[i].getUnreadNotificationCount();
|
||||
// instead, we just count the number of rooms with notifs.
|
||||
notifCount++;
|
||||
}
|
||||
}
|
||||
let notifCount = countRoomsWithNotif(MatrixClientPeg.get().getRooms()).count;
|
||||
|
||||
if (PlatformPeg.get()) {
|
||||
PlatformPeg.get().setErrorStatus(state === 'ERROR');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue