mirror of
https://github.com/wassname/talk.git
synced 2026-07-04 08:46:13 +08:00
Merge branch 'master' into i18n-serverside-plugins
This commit is contained in:
@@ -25,8 +25,28 @@ class SortedWindowHandler {
|
||||
*/
|
||||
windowHandles(callback) {
|
||||
this.client.windowHandles((result) => {
|
||||
this.handles = this.handles.filter((handle) => result.value.includes(handle));
|
||||
const remaining = result.value.filter((handle) => !this.handles.includes(handle));
|
||||
if (Array.isArray(result.value)) {
|
||||
this.handles = this.handles.filter((handle) => {
|
||||
for (let i = 0; i < result.value.length; i++) {
|
||||
if (result.value[i] === handle) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
this.handles = [];
|
||||
}
|
||||
const remaining = result.value.filter((handle) => {
|
||||
for (let i = 0; i < this.handles.length; i++) {
|
||||
if (this.handles[i] === handle) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
if (remaining.length === 1) {
|
||||
this.handles.push(remaining[0]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user