Skip to content

Commit

Permalink
Merge pull request #202 from DecentralCardGame/balanceAnchorForJannik
Browse files Browse the repository at this point in the history
fix bugs in card creator (no error notification messages and special …
  • Loading branch information
patrickwieth authored Sep 27, 2023
2 parents 212facf + 1906396 commit 07bba68
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/views/CardCreatorPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -806,8 +806,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() {
Expand Down Expand Up @@ -883,7 +883,11 @@ export default {
return printString.length > 1 ? R.dropLast(1, printString) : "";
},
showBuyFrameModal() {
this.isBuyFrameModalVisible = true;
if (!this.address) {
this.notifyFail("Unable to buy Card Frame", "You must be logged in with an activated account for this.");
}
else
this.isBuyFrameModalVisible = true;
},
closeBuyFrameModal() {
this.isBuyFrameModalVisible = false;
Expand Down Expand Up @@ -1232,7 +1236,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("Unable publish Card", "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.");
Expand All @@ -1247,6 +1255,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);
});
}
},
Expand Down

0 comments on commit 07bba68

Please sign in to comment.