Skip to content

Commit

Permalink
fix: (strf-5280) Multiple themes - Changes to config.json not reflected
Browse files Browse the repository at this point in the history
  • Loading branch information
jairo-bc committed Sep 14, 2020
1 parent fc62b19 commit 0b28309
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bin/stencil-start.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,13 @@ async function startServer() {
}
});

Bs.watch('config.json', event => {
if (event === 'change') {
themeConfig.resetVariationSettings();
Bs.reload();
}
});

Bs.watch('.config/storefront.json', (event, file) => {
if (event === 'change') {
console.log("storefront json changed");
Expand Down
9 changes: 9 additions & 0 deletions lib/theme-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@ ThemeConfig.prototype.setThemePath = function (themePath) {
return this;
};

/**
* Reset Current Variation Settings
*
* @returns {ThemeConfig}
*/
ThemeConfig.prototype.resetVariationSettings = function () {
this.currentVariationSettings = null;
};

/**
* Variation Name Setter
*
Expand Down

0 comments on commit 0b28309

Please sign in to comment.