diff --git a/frontend/src/classes/Deck.js b/frontend/src/classes/Deck.js index f7aaedc..4d84216 100644 --- a/frontend/src/classes/Deck.js +++ b/frontend/src/classes/Deck.js @@ -161,6 +161,9 @@ export default class { } deckList() { + // empty deck is empty + if (this.count() == 0) return '' + let lines = [] // begin with deck name and note diff --git a/frontend/src/components/forms/DeckEditor.vue b/frontend/src/components/forms/DeckEditor.vue index 611b6c2..db4c149 100644 --- a/frontend/src/components/forms/DeckEditor.vue +++ b/frontend/src/components/forms/DeckEditor.vue @@ -11,9 +11,15 @@ import Deck from '@/classes/Deck' +import CardsDB from '@/plugins/ffdecks' export default { name: 'DeckEditor', @@ -53,6 +60,21 @@ export default { new_deck: null }), + computed: { + format_sample() { + let serials = [] + for (let tmp_key in CardsDB) { + if (CardsDB.hasOwnProperty(tmp_key)) { + serials.push(tmp_key) + } + } + + let quantity = Math.floor(Math.random() * 3) + 1 + let serial = serials[Math.floor(Math.random() * serials.length)] + return `${quantity}x ${serial}` + } + }, + created() { this.clear() },