Skip to content

Commit

Permalink
Fix several issues
Browse files Browse the repository at this point in the history
- visiting Translate.Next shows Pontoon Tools as not signed in, #97
- after installation errors are shown in console
  • Loading branch information
MikkCZ committed Aug 25, 2019
1 parent 7ba8bc8 commit f345874
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
10 changes: 6 additions & 4 deletions src/packages/background/ContextButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ class ContextButtons {
* @private
*/
_initMozillaWebsitesList(projects) {
this._mozillaWebsites = [];
Object.values(projects).forEach((project) =>
project.domains.forEach((domain) => this._mozillaWebsites.push(`https://${domain}`))
);
if (projects) {
this._mozillaWebsites = [];
Object.values(projects).forEach((project) =>
project.domains.forEach((domain) => this._mozillaWebsites.push(`https://${domain}`))
);
}
}

/**
Expand Down
6 changes: 1 addition & 5 deletions src/packages/background/RemotePontoon.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,10 @@ class RemotePontoon {
notificationsIdsFromPage,
]) => {
const notificationsInStorage = storageItem[dataKey];
if (!notificationsIdsFromPage.every(id => id in notificationsInStorage)) {
if (!notificationsInStorage || !notificationsIdsFromPage.every(id => id in notificationsInStorage)) {
this.updateNotificationsData();
}
});
} else if (page.title === 'Translate.Next') {
// Translate.Next does not contain notifications in DOM
} else {
browser.storage.local.set({notificationsData: undefined});
}
}

Expand Down

0 comments on commit f345874

Please sign in to comment.