From eb24802d375f46c3a615fd1904993f114162f440 Mon Sep 17 00:00:00 2001 From: Rene Fischer Date: Mon, 27 Jul 2020 00:17:04 +0200 Subject: [PATCH] refactor code as remarked + add uuid to test deck --- cli/test.json | 3 ++- src/helpers/addDecksHelper.ts | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cli/test.json b/cli/test.json index 4d4001c..54bed67 100644 --- a/cli/test.json +++ b/cli/test.json @@ -1,7 +1,8 @@ { "meta": { "author": "Niko Lockenvitz & Rene-Pascal Fischer", - "version": "1.1.1" + "version": "1.1.1", + "uuid": "6d4b5420-3c3e-42bc-addd-019597fd438b" }, "decks": { "d0": { diff --git a/src/helpers/addDecksHelper.ts b/src/helpers/addDecksHelper.ts index 4ed92a8..611594a 100644 --- a/src/helpers/addDecksHelper.ts +++ b/src/helpers/addDecksHelper.ts @@ -87,9 +87,7 @@ export function addDecksFromJSON( addedDecksAndCards.push({ name, numberOfCards: cards.length }); } - const version = fileContent.meta.version - ? fileContent.meta.version - : undefined; + const version = fileContent?.meta?.version; showAddedDecksConfirmation( context,