mirror of
https://github.com/zen-browser/components.git
synced 2025-07-10 19:05:30 +02:00
fix(zenThemes): themes not being updated in other windows
This commit is contained in:
parent
3c66cbdc24
commit
4a9f91b6cb
2 changed files with 23 additions and 20 deletions
|
@ -12,6 +12,14 @@ var ZenThemesCommon = {
|
|||
return this.kZenOSToSmallName[os];
|
||||
},
|
||||
|
||||
get browsers() {
|
||||
return Services.wm.getEnumerator('navigator:browser');
|
||||
},
|
||||
|
||||
get currentBrowser() {
|
||||
return Services.wm.getMostRecentWindow('navigator:browser');
|
||||
},
|
||||
|
||||
get themesRootPath() {
|
||||
return PathUtils.join(PathUtils.profileDir, 'chrome', 'zen-themes');
|
||||
},
|
||||
|
@ -24,22 +32,15 @@ var ZenThemesCommon = {
|
|||
return PathUtils.join(this.themesRootPath, themeId);
|
||||
},
|
||||
|
||||
getBrowser() {
|
||||
if (!this.__browser) {
|
||||
this.__browser = Services.wm.getMostRecentWindow('navigator:browser');
|
||||
}
|
||||
|
||||
return this.__browser;
|
||||
},
|
||||
|
||||
async getThemes() {
|
||||
if (!this._themes) {
|
||||
if (!this.themes) {
|
||||
if (!(await IOUtils.exists(this.themesDataFile))) {
|
||||
await IOUtils.writeJSON(this.themesDataFile, {});
|
||||
}
|
||||
this._themes = await IOUtils.readJSON(this.themesDataFile);
|
||||
|
||||
this.themes = await IOUtils.readJSON(this.themesDataFile);
|
||||
}
|
||||
return this._themes;
|
||||
return this.themes;
|
||||
},
|
||||
|
||||
async getThemePreferences(theme) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue