[polari/wip/raresv/popoverRebasedOnTracker] userTracker: Fix untracking members on disconnect
- From: Rares Visalom <raresvisalom src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/raresv/popoverRebasedOnTracker] userTracker: Fix untracking members on disconnect
- Date: Tue, 26 Jul 2016 23:04:01 +0000 (UTC)
commit edf9cc000cd848b2a9b45c7d1406e87a223ea1f5
Author: Florian Müllner <fmuellner gnome org>
Date: Tue Jul 26 23:05:21 2016 +0200
userTracker: Fix untracking members on disconnect
Array.forEach() doesn't handle array changes while running the loop,
so replace it with a while loop that can deal with the changing
array size.
src/userTracker.js | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/userTracker.js b/src/userTracker.js
index 2b00308..43b286b 100644
--- a/src/userTracker.js
+++ b/src/userTracker.js
@@ -188,7 +188,8 @@ const UserTracker = new Lang.Class({
_clearUsersFromRoom: function(room) {
let map = this._getRoomContacts(room);
for ([baseNick, contacts] of map)
- contacts.forEach((m) => { this._untrackMember(m, room); });
+ while (contacts.length > 0)
+ this._untrackMember(contacts[0], room);
},
_ensureRoomMappingForRoom: function(room) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]