Fixing closing of all websites.
This commit is contained in:
parent
787cc508b8
commit
0fb09cc431
@ -612,17 +612,16 @@ class CoWebsiteManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public closeCoWebsites(): Promise<void> {
|
public async closeCoWebsites(): Promise<void> {
|
||||||
this.currentOperationPromise = this.currentOperationPromise.then(() => {
|
await this.currentOperationPromise;
|
||||||
const promises: Promise<void>[] = [];
|
|
||||||
this.coWebsites.forEach((coWebsite: CoWebsite) => {
|
const promises: Promise<void>[] = [];
|
||||||
promises.push(this.closeCoWebsite(coWebsite));
|
this.coWebsites.forEach((coWebsite: CoWebsite) => {
|
||||||
});
|
promises.push(this.closeCoWebsite(coWebsite));
|
||||||
return Promise.all(promises).then(() => {
|
|
||||||
return;
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
return this.currentOperationPromise;
|
await Promise.all(promises);
|
||||||
|
// TODO: this.currentOperationPromise does not point any more on the last promise
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getGameSize(): { width: number; height: number } {
|
public getGameSize(): { width: number; height: number } {
|
||||||
|
Loading…
Reference in New Issue
Block a user