diff --git a/src/csui/Popup.vue b/src/csui/Popup.vue index 9a6394d..fd14c11 100644 --- a/src/csui/Popup.vue +++ b/src/csui/Popup.vue @@ -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(); diff --git a/src/csui/src/PlayerUIWindow.vue b/src/csui/src/PlayerUIWindow.vue index 3ddfeba..7d5e9ee 100644 --- a/src/csui/src/PlayerUIWindow.vue +++ b/src/csui/src/PlayerUIWindow.vue @@ -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', diff --git a/src/csui/src/PlayerUiPanels/PanelComponents/ExtensionSettings/SiteExtensionSettings.vue b/src/csui/src/PlayerUiPanels/PanelComponents/ExtensionSettings/SiteExtensionSettings.vue index 3d7e5f7..d84e958 100644 --- a/src/csui/src/PlayerUiPanels/PanelComponents/ExtensionSettings/SiteExtensionSettings.vue +++ b/src/csui/src/PlayerUiPanels/PanelComponents/ExtensionSettings/SiteExtensionSettings.vue @@ -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; diff --git a/src/ext/lib/settings/SiteSettings.ts b/src/ext/lib/settings/SiteSettings.ts index e76b1f3..c05f191 100644 --- a/src/ext/lib/settings/SiteSettings.ts +++ b/src/ext/lib/settings/SiteSettings.ts @@ -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();