Skip to content

Commit 7dbed3a

Browse files
committed
fixed update method in PrivacyListProxy
1 parent d319ba2 commit 7dbed3a

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

js/modules/qbChat.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,21 +1084,22 @@ PrivacyListProxy.prototype = {
10841084
},
10851085

10861086
update: function(list, callback) {
1087-
var self = this,
1088-
oldArray = [],
1089-
newArray = [],
1090-
updatedArray = [];
1087+
var self = this, copyList = list;
10911088

1092-
self.getList(list.name, function(error, response) {
1089+
self.getList(copyList.name, function(error, response) {
10931090
if (error) {
10941091
callback(error, null);
10951092
}else{
1096-
oldArray = response.items;
1097-
newArray = list.items;
1093+
var oldArray = response.items,
1094+
newArray = copyList.items,
1095+
updatedArray = [],
1096+
createList = {};
1097+
10981098
updatedArray = $.merge(oldArray, newArray);
1099-
list.items = updatedArray;
1099+
copyList.items = updatedArray;
1100+
createList = copyList;
11001101

1101-
self.create(list, function(error, response) {
1102+
self.create(createList, function(error, response) {
11021103
if (error) {
11031104
callback(error, null);
11041105
}else{

0 commit comments

Comments
 (0)