Skip to content

Commit

Permalink
Merge pull request #41 from ydakuka/fix-undefined-error
Browse files Browse the repository at this point in the history
Fix error when data is empty
  • Loading branch information
mdnsk authored Mar 21, 2020
2 parents 49a700e + 4eda912 commit 34f2cef
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 34f2cef

Please sign in to comment.