diff --git a/narou-reader/background.js b/narou-reader/background.js index fc1d7d4..afde796 100644 --- a/narou-reader/background.js +++ b/narou-reader/background.js @@ -5367,7 +5367,12 @@ var DictionariesManager = function () { var newRubies = this.getNewRubiesOnly(newDictionary, storageDictionary); newDictionary.raw = newRubies.length ? storageDictionary.raw + ('\n' + this.getDictionaryText(newRubies)) : storageDictionary.raw; } - newDictionary.rubies = newDictionary.raw ? this.getRubies(newDictionary.raw) : this.getRubies(storageDictionary.raw); + if (newDictionary.raw) { + newDictionary.rubies = this.getRubies(newDictionary.raw); + } else { + delete newDictionary.raw; + newDictionary.rubies = this.getRubies(storageDictionary.raw); + } } else { newDictionary.raw = newDictionary.raw || ''; newDictionary.rubies = this.getRubies(newDictionary.raw); diff --git a/narou-reader/options.js b/narou-reader/options.js index 0d560d8..86e1594 100644 --- a/narou-reader/options.js +++ b/narou-reader/options.js @@ -15703,7 +15703,12 @@ var DictionariesManager = function () { var newRubies = this.getNewRubiesOnly(newDictionary, storageDictionary); newDictionary.raw = newRubies.length ? storageDictionary.raw + ('\n' + this.getDictionaryText(newRubies)) : storageDictionary.raw; } - newDictionary.rubies = newDictionary.raw ? this.getRubies(newDictionary.raw) : this.getRubies(storageDictionary.raw); + if (newDictionary.raw) { + newDictionary.rubies = this.getRubies(newDictionary.raw); + } else { + delete newDictionary.raw; + newDictionary.rubies = this.getRubies(storageDictionary.raw); + } } else { newDictionary.raw = newDictionary.raw || ''; newDictionary.rubies = this.getRubies(newDictionary.raw); diff --git a/src/js/DictionariesManager.js b/src/js/DictionariesManager.js index 40d9519..56e7f66 100644 --- a/src/js/DictionariesManager.js +++ b/src/js/DictionariesManager.js @@ -15,9 +15,12 @@ export default class DictionariesManager { ? storageDictionary.raw + `\n${this.getDictionaryText(newRubies)}` : storageDictionary.raw } - newDictionary.rubies = newDictionary.raw - ? this.getRubies(newDictionary.raw) - : this.getRubies(storageDictionary.raw) + if(newDictionary.raw) { + newDictionary.rubies = this.getRubies(newDictionary.raw) + } else { + delete newDictionary.raw + newDictionary.rubies = this.getRubies(storageDictionary.raw) + } } else { newDictionary.raw = newDictionary.raw || '' newDictionary.rubies = this.getRubies(newDictionary.raw)