Skip to content

Commit

Permalink
Merge pull request #1467 from NetsBlox/duplicate-cloud-error-save-as-…
Browse files Browse the repository at this point in the history
…dialog

Remove duplicate cloud error dialog (only use onerror handler)
  • Loading branch information
brollb authored Nov 17, 2023
2 parents bb1e7e7 + ee6a783 commit c28c2e4
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -7199,19 +7199,16 @@ SaveOpenDialogMorph.prototype.trySaveItem = async function(newItem) {
if (!overwrite) return;
}

try {
const sourceName = localize(this.source.name.toLowerCase());
const savingMsg = localize(`Saving ${this.itemName.toLowerCase()}\nto the `) +
sourceName + '...';
const savedMsg = localize('Saved to the ') + sourceName + '!';

this.ide.showMessage(savingMsg);
await this.saveItem(newItem, {overwrite});
this.ide.showMessage(savedMsg, 2);
this.destroy();
} catch (err) {
this.ide.cloudError().call(null, err.label, err.message);
}
const sourceName = localize(this.source.name.toLowerCase());
const savingMsg = localize(`Saving ${this.itemName.toLowerCase()}\nto the `) +
sourceName + '...';
const savedMsg = localize('Saved to the ') + sourceName + '!';

this.ide.showMessage(savingMsg);
await this.saveItem(newItem, {overwrite});
this.ide.showMessage(savedMsg, 2);
this.destroy();

return newItem;
};

Expand Down

0 comments on commit c28c2e4

Please sign in to comment.