Refactor new deck logic

This commit is contained in:
Nathaniel Bond
2024-12-30 10:50:32 -05:00
parent d32e1ab6a6
commit 8d8ba2179a

View File

@@ -148,15 +148,8 @@ var GempLotrDeckBuildingUI = Class.extend({
newDeckBut.click(
function () {
if (that.deckContentsDirty) {
if (confirm("Do you wish to save this deck?")) {
if (that.saveCurrentDeck()) {
that.deckName = null;
$("#editingDeck").text("New deck");
that.clearDeck();
}
}
} else {
if (!that.deckContentsDirty ||
(confirm("Do you wish to save this deck?") && that.saveCurrentDeck())) {
that.deckName = null;
$("#editingDeck").text("New deck");
that.clearDeck();