Skip to content

Commit

Permalink
Fix error when data is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
ydakuka committed Mar 19, 2020
1 parent 49a700e commit 4eda912
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Leo Translate",
"version": "1.17.5",
"version": "1.17.6",

"description": "Translate words on the internet pages using LinguaLeo API and add words to the LinguaLeo Dictionary.",

Expand Down
2 changes: 1 addition & 1 deletion src/vue/Translate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
.then(data => {
let notification = '';
if (data.error_msg === '') {
if (Object.keys(data).length === 0 || data.error_msg === '') {
notification = `The "${this.text}" word has been added!`;
history.addWord(this.text, translation, this.soundUrl);
} else {
Expand Down

0 comments on commit 4eda912

Please sign in to comment.