Merge pull request #1709 from thecodingmachine/fix_close_webites
Fixing closing of all websites.
This commit is contained in:
commit
201332bfc8
@ -612,17 +612,16 @@ class CoWebsiteManager {
|
||||
}
|
||||
}
|
||||
|
||||
public closeCoWebsites(): Promise<void> {
|
||||
this.currentOperationPromise = this.currentOperationPromise.then(() => {
|
||||
const promises: Promise<void>[] = [];
|
||||
this.coWebsites.forEach((coWebsite: CoWebsite) => {
|
||||
promises.push(this.closeCoWebsite(coWebsite));
|
||||
});
|
||||
return Promise.all(promises).then(() => {
|
||||
return;
|
||||
});
|
||||
public async closeCoWebsites(): Promise<void> {
|
||||
await this.currentOperationPromise;
|
||||
|
||||
const promises: Promise<void>[] = [];
|
||||
this.coWebsites.forEach((coWebsite: CoWebsite) => {
|
||||
promises.push(this.closeCoWebsite(coWebsite));
|
||||
});
|
||||
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 } {
|
||||
|
Loading…
Reference in New Issue
Block a user