From bf668d89cde47f97202280c6a2543b2d2edfe514 Mon Sep 17 00:00:00 2001 From: Patrick Wieth Date: Wed, 20 Sep 2023 22:13:47 +0200 Subject: [PATCH 1/2] fix bugs in card creator (no error notification messages and special cost broken) --- src/views/CardCreatorPage.vue | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/views/CardCreatorPage.vue b/src/views/CardCreatorPage.vue index 5dbe883a..a80d8ae5 100644 --- a/src/views/CardCreatorPage.vue +++ b/src/views/CardCreatorPage.vue @@ -805,8 +805,8 @@ export default { }, getGenericCostRange(key: string) { return R.range( - cardRules.Card.children[this.getRulesType()].children.AdditionalCost.children[key].children.Amount.min || 0, - cardRules.Card.children[this.getRulesType()].children.AdditionalCost.children[key].children.Amount.max + 1 + this.cardRules.Card.children[this.getRulesType()].children.AdditionalCost.children[key].children.Amount.min || 0, + this.cardRules.Card.children[this.getRulesType()].children.AdditionalCost.children[key].children.Amount.max + 1 ); }, getSpecialCostRange() { @@ -882,7 +882,11 @@ export default { return printString.length > 1 ? R.dropLast(1, printString) : ""; }, showBuyFrameModal() { - this.isBuyFrameModalVisible = true; + if (!this.address) { + this.notifyFail("Buy Card Frame failed", "You must be logged in with an activated account for this."); + } + else + this.isBuyFrameModalVisible = true; }, closeBuyFrameModal() { this.isBuyFrameModalVisible = false; @@ -1219,7 +1223,11 @@ export default { saveCardContent(this.model.id, newCard, this.resetCard, handleErr); if (!this.designateArtist) addArtwork(this.model.id, newCard.image, newCard.fullArt, this.resetCard, handleErr); - } else { + } + else if (!this.address) { + this.notifyFail("Publish Card failed", "You must be logged in with an activated account!"); + } + else { queryQUser(this.address).then((res: User) => { if (R.isEmpty(res.ownedCardSchemes)) { this.notifyFail("YOU MUST CONSTRUCT ADDITIONAL PYLONS", "You don't own any Card Frames. Please buy one before publishing."); @@ -1234,6 +1242,10 @@ export default { saveCardContent(id, newCard, this.resetCard, handleErr); if (!this.designateArtist) addArtwork(id, newCard.image, newCard.fullArt, this.resetCard, handleErr); } + }) + .catch(err => { + console.error(err); + this.notifyFail("Publish Card failed", err); }); } }, From 19063964439bdda4c61993958af97379f080da67 Mon Sep 17 00:00:00 2001 From: Patrick Date: Wed, 27 Sep 2023 21:28:44 +0200 Subject: [PATCH 2/2] change failed error message to unable --- src/views/CardCreatorPage.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/CardCreatorPage.vue b/src/views/CardCreatorPage.vue index a80d8ae5..f2744cac 100644 --- a/src/views/CardCreatorPage.vue +++ b/src/views/CardCreatorPage.vue @@ -883,7 +883,7 @@ export default { }, showBuyFrameModal() { if (!this.address) { - this.notifyFail("Buy Card Frame failed", "You must be logged in with an activated account for this."); + this.notifyFail("Unable to buy Card Frame", "You must be logged in with an activated account for this."); } else this.isBuyFrameModalVisible = true; @@ -1225,7 +1225,7 @@ export default { if (!this.designateArtist) addArtwork(this.model.id, newCard.image, newCard.fullArt, this.resetCard, handleErr); } else if (!this.address) { - this.notifyFail("Publish Card failed", "You must be logged in with an activated account!"); + this.notifyFail("Unable publish Card", "You must be logged in with an activated account!"); } else { queryQUser(this.address).then((res: User) => {