This commit is contained in:
pypy
2020-01-27 15:21:59 +09:00
parent 9d4f87f2f4
commit eeb038e82c
+9 -1
View File
@@ -2373,6 +2373,7 @@ CefSharp.BindObjectAsync(
'world': this.favoriteWorldGroups, 'world': this.favoriteWorldGroups,
'avatar': this.favoriteAvatarGroups 'avatar': this.favoriteAvatarGroups
}; };
var assigns = new Set();
// assign the same name first // assign the same name first
for (var ref of this.cachedFavoriteGroups.values()) { for (var ref of this.cachedFavoriteGroups.values()) {
if (ref.$isDeleted) { if (ref.$isDeleted) {
@@ -2388,14 +2389,20 @@ CefSharp.BindObjectAsync(
group.assign = true; group.assign = true;
group.displayName = ref.displayName; group.displayName = ref.displayName;
ref.$groupRef = group; ref.$groupRef = group;
assigns.add(ref.id);
break; break;
} }
} }
} }
// assign the rest // assign the rest
// FIXME
// The order (cachedFavoriteGroups) is very important. It should be
// processed in the order in which the server responded. But since we
// used Map(), the order would be a mess. So we need something to solve
// this.
for (var ref of this.cachedFavoriteGroups.values()) { for (var ref of this.cachedFavoriteGroups.values()) {
if (ref.$isDeleted || if (ref.$isDeleted ||
ref.$ref) { assigns.has(ref.id)) {
continue; continue;
} }
var groups = types[ref.type]; var groups = types[ref.type];
@@ -2409,6 +2416,7 @@ CefSharp.BindObjectAsync(
group.name = ref.name; group.name = ref.name;
group.displayName = ref.displayName; group.displayName = ref.displayName;
ref.$groupRef = group; ref.$groupRef = group;
assigns.add(ref.id);
break; break;
} }
} }