зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1109511: listen for the 'delete' event to update the toolbar icon when a room is deleted. r=Niko
This commit is contained in:
Родитель
1186e7affc
Коммит
8635e10457
|
@ -135,7 +135,7 @@ let LoopRoomsInternal = {
|
|||
get participantsCount() {
|
||||
let count = 0;
|
||||
for (let room of this.rooms.values()) {
|
||||
if (!("participants" in room)) {
|
||||
if (room.deleted || !("participants" in room)) {
|
||||
continue;
|
||||
}
|
||||
count += room.participants.length;
|
||||
|
|
|
@ -1073,11 +1073,13 @@ this.MozLoopService = {
|
|||
|
||||
// The Loop toolbar button should change icon when the room participant count
|
||||
// changes from 0 to something.
|
||||
const onRoomsChange = () => {
|
||||
MozLoopServiceInternal.notifyStatusChanged();
|
||||
const onRoomsChange = (e) => {
|
||||
// Pass the event name as notification reason for better logging.
|
||||
MozLoopServiceInternal.notifyStatusChanged("room-" + e);
|
||||
};
|
||||
LoopRooms.on("add", onRoomsChange);
|
||||
LoopRooms.on("update", onRoomsChange);
|
||||
LoopRooms.on("delete", onRoomsChange);
|
||||
LoopRooms.on("joined", (e, room, participant) => {
|
||||
// Don't alert if we're in the doNotDisturb mode, or the participant
|
||||
// is the owner - the content code deals with the rest of the sounds.
|
||||
|
|
Загрузка…
Ссылка в новой задаче