Fixed theme settings for non-active theme being destroyed/updated when syncing

no issue

- the `.browse()` call to fetch themes was not structured to filter out themes correctly so it was fetching all theme settings rather than only settings related to the current theme
This commit is contained in:
Kevin Ansfield 2021-10-04 12:14:08 +01:00
parent ef136a2029
commit 1a9087cfa8

View File

@ -113,7 +113,7 @@ module.exports = class CustomThemeSettingsService {
async syncRepositoryWithTheme(theme) {
const themeSettings = theme.customSettings || {};
const settingsCollection = await this.repository.browse({theme: theme.themeName});
const settingsCollection = await this.repository.browse({filter: `theme:${theme.name}`});
let knownSettings = settingsCollection.toJSON();
// exit early if there's nothing to sync for this theme
@ -164,7 +164,7 @@ module.exports = class CustomThemeSettingsService {
}
}
const updatedSettingsCollection = await this.repository.browse({theme: theme.themeName});
const updatedSettingsCollection = await this.repository.browse({filter: `theme:${theme.name}`});
return updatedSettingsCollection.toJSON();
}