Fix problem where 'default' is always 'disabled'

This commit is contained in:
Tamius Han 2025-03-31 00:20:43 +02:00
parent f0840b78e1
commit a5c9835d9d
4 changed files with 11 additions and 4 deletions

View File

@ -175,7 +175,7 @@ export default {
}
},
mounted() {
this.tabs.find(x => x.id === 'changelog').highlight = !this.settings.active.whatsNewChecked;
this.tabs.find(x => x.id === 'changelog').highlight = !this.settings.active?.whatsNewChecked;
},
async created() {
this.logger = new Logger();

View File

@ -206,7 +206,7 @@ export default {
this.selectedTab = this.defaultTab;
}
this.siteSettings = this.settings.getSiteSettings(this.site);
this.tabs.find(x => x.id === 'changelog').highlight = !this.settings.active.whatsNewChecked;
this.tabs.find(x => x.id === 'changelog').highlight = !this.settings.active?.whatsNewChecked;
this.eventBus.subscribe(
'uw-show-ui',

View File

@ -352,12 +352,15 @@ export default {
return '??';
}
},
mounted() {
this.forceRefreshPage();
},
methods: {
/**
* Compiles our extension settings into more user-friendly options
*/
compileSimpleSettings(component, getFor = 'site') {
// console.log('compiling simple settings!', component, getFor, 'site settings?', this.siteSettings);
let settingsData;
switch (getFor) {
case 'site':
@ -517,6 +520,9 @@ export default {
// we also need to force re-compute all watchers, otherwise UI will lag behind
// actual state of settings until reload
this.forceRefreshPage();
},
forceRefreshPage() {
this._computedWatchers?.simpleExtensionSettings?.run();
this._computedWatchers?.simpleDefaultSettings?.run();
this._computedWatchers?.siteDefaultCrop?.run();
@ -527,6 +533,7 @@ export default {
this.$nextTick( () => this.$forceUpdate());
},
setExtensionMode(component, event) {
const option = event.target.value;

View File

@ -30,7 +30,7 @@ export class SiteSettings {
this.settings = settings;
this.raw = settings.active.sites[site];
this.site = site;
this.defaultSettings = settings.default.sites['@global'];
this.defaultSettings = settings.active.sites['@global'];
this.compileSettingsObject();