mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-06-13 13:04:03 +00:00
Minor adjustments
This commit is contained in:
parent
331d08d61c
commit
77eaf33060
@ -130,7 +130,7 @@ export class HUDPuzzleCompleteNotification extends BaseHUDPart {
|
||||
|
||||
report() {
|
||||
const mode = /** @type {PuzzlePlayGameMode} */ (this.root.gameMode);
|
||||
mode.reportPuzzle();
|
||||
mode.reportPuzzle().then(() => this.close());
|
||||
}
|
||||
|
||||
updateState() {
|
||||
|
@ -147,25 +147,28 @@ export class PuzzlePlayGameMode extends PuzzleGameMode {
|
||||
}
|
||||
);
|
||||
|
||||
optionSelected.add(option => {
|
||||
const closeLoading = this.root.hud.parts.dialogs.showLoadingDialog();
|
||||
return new Promise(resolve => {
|
||||
optionSelected.add(option => {
|
||||
const closeLoading = this.root.hud.parts.dialogs.showLoadingDialog();
|
||||
|
||||
this.root.app.clientApi.apiReportPuzzle(this.puzzle.meta.id, option).then(
|
||||
() => {
|
||||
closeLoading();
|
||||
this.root.hud.parts.dialogs.showInfo(
|
||||
T.dialogs.puzzleReportComplete.title,
|
||||
T.dialogs.puzzleReportComplete.desc
|
||||
);
|
||||
},
|
||||
err => {
|
||||
closeLoading();
|
||||
this.root.hud.parts.dialogs.showInfo(
|
||||
T.dialogs.puzzleReportError.title,
|
||||
T.dialogs.puzzleReportError.desc + " " + err
|
||||
);
|
||||
}
|
||||
);
|
||||
this.root.app.clientApi.apiReportPuzzle(this.puzzle.meta.id, option).then(
|
||||
() => {
|
||||
closeLoading();
|
||||
const { ok } = this.root.hud.parts.dialogs.showInfo(
|
||||
T.dialogs.puzzleReportComplete.title,
|
||||
T.dialogs.puzzleReportComplete.desc
|
||||
);
|
||||
ok.add(resolve);
|
||||
},
|
||||
err => {
|
||||
closeLoading();
|
||||
const { ok } = this.root.hud.parts.dialogs.showInfo(
|
||||
T.dialogs.puzzleReportError.title,
|
||||
T.dialogs.puzzleReportError.desc + " " + err
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user