Skip to content

Commit

Permalink
fix dictionary manager for none ruby dictionary with force flag
Browse files Browse the repository at this point in the history
  • Loading branch information
snowsunny committed Oct 28, 2017
1 parent 9b40560 commit 4848a2a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
8 changes: 6 additions & 2 deletions narou-reader/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -5370,8 +5370,12 @@ var DictionariesManager = function () {
if (newDictionary.raw) {
newDictionary.rubies = this.getRubies(newDictionary.raw);
} else {
delete newDictionary.raw;
newDictionary.rubies = this.getRubies(storageDictionary.raw);
if (forceFlag) {
newDictionary.rubies = [];
} else {
newDictionary.rubies = this.getRubies(storageDictionary.raw);
delete newDictionary.raw;
}
}
} else {
newDictionary.raw = newDictionary.raw || '';
Expand Down
8 changes: 6 additions & 2 deletions narou-reader/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -15706,8 +15706,12 @@ var DictionariesManager = function () {
if (newDictionary.raw) {
newDictionary.rubies = this.getRubies(newDictionary.raw);
} else {
delete newDictionary.raw;
newDictionary.rubies = this.getRubies(storageDictionary.raw);
if (forceFlag) {
newDictionary.rubies = [];
} else {
newDictionary.rubies = this.getRubies(storageDictionary.raw);
delete newDictionary.raw;
}
}
} else {
newDictionary.raw = newDictionary.raw || '';
Expand Down
8 changes: 6 additions & 2 deletions src/js/DictionariesManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ export default class DictionariesManager {
if(newDictionary.raw) {
newDictionary.rubies = this.getRubies(newDictionary.raw)
} else {
delete newDictionary.raw
newDictionary.rubies = this.getRubies(storageDictionary.raw)
if(forceFlag) {
newDictionary.rubies = []
} else {
newDictionary.rubies = this.getRubies(storageDictionary.raw)
delete newDictionary.raw
}
}
} else {
newDictionary.raw = newDictionary.raw || ''
Expand Down

0 comments on commit 4848a2a

Please sign in to comment.