From e8c31a86d583766a3ee4eec8f6d83dbb8392edaa Mon Sep 17 00:00:00 2001 From: Robbie Antenesse Date: Mon, 30 Nov 2015 16:28:21 -0700 Subject: [PATCH] Forced imports to always create a new dictionary. --- js/dictionaryBuilder.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/dictionaryBuilder.js b/js/dictionaryBuilder.js index 1a5a4d2..fb0afdd 100644 --- a/js/dictionaryBuilder.js +++ b/js/dictionaryBuilder.js @@ -568,12 +568,12 @@ function ImportDictionary() { if (tmpDicitonary.hasOwnProperty("name") && tmpDicitonary.hasOwnProperty("description") && tmpDicitonary.hasOwnProperty("words") && tmpDicitonary.hasOwnProperty("settings")) { - localStorage.setItem('dictionary', reader.result); - document.getElementById("importFile").value = ""; - LoadLocalDictionary(); - SendDictionary(true); + currentDictionary = JSON.parse(reader.result); + currentDictionary.externalID = 0; // Reset external id for imported dictionary. + SaveDictionary(true, true); ProcessLoad(); HideSettings(); + document.getElementById("importFile").value = ""; } else { var errorString = "File is missing:"; if (!tmpDicitonary.hasOwnProperty("name"))