Extension enabled mode is now being set correctly
This commit is contained in:
parent
61972a7b2d
commit
c2a6a3f082
@ -96,7 +96,6 @@ class Settings {
|
||||
if (!changes.uwSettings) {
|
||||
return;
|
||||
}
|
||||
console.log('new settings change.')
|
||||
this.logger?.info('storageOnChange', "Settings have been changed outside of here. Updating active settings. Changes:", changes, "storage area:", area);
|
||||
// if (changes['uwSettings'] && changes['uwSettings'].newValue) {
|
||||
// this.logger?.log('info', 'settings',"[Settings::<storage/on change>] new settings object:", JSON.parse(changes.uwSettings.newValue));
|
||||
|
||||
@ -183,7 +183,6 @@ export class SiteSettings {
|
||||
*/
|
||||
private compileSettingsObject() {
|
||||
const {siteSettings, usesSettingsFor} = this.getSettingsForSite(this.options);
|
||||
console.log('got settings for site:', siteSettings, usesSettingsFor)
|
||||
|
||||
this.data = _cp(siteSettings);
|
||||
this.usesSettingsFor = usesSettingsFor;
|
||||
|
||||
@ -532,7 +532,11 @@ class VideoData {
|
||||
let confirmAspectRatioRestore = false;
|
||||
|
||||
if (!this.video) {
|
||||
if (this.logger) {
|
||||
this.logger.error('onVideoMutation', 'mutation was triggered, but video element is missing. Something is fishy. Terminating this uw instance.');
|
||||
} else {
|
||||
console.error('uw::onVideoMutation', 'mutation was triggered, but neither video nor logger exist. Something is ultra-fishy. UW instance will be terminated. This:', this);
|
||||
}
|
||||
this.destroy();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -105,8 +105,8 @@
|
||||
<h3>Default settings</h3>
|
||||
<SiteExtensionSettings
|
||||
:settings="settings"
|
||||
:siteSettings="siteSettings"
|
||||
:isDefaultConfiguration="false"
|
||||
:siteSettings="globalSettings"
|
||||
:isDefaultConfiguration="true"
|
||||
></SiteExtensionSettings>
|
||||
</template>
|
||||
|
||||
@ -220,7 +220,13 @@ const AVAILABLE_TABS = {
|
||||
{ id: 'default-extension-settings', label: 'Default settings' }
|
||||
]
|
||||
},
|
||||
'extensionSettings': {id: 'extensionSettings', label: 'Site and Extension options', icon: 'cogs' },
|
||||
'extension-settings': {
|
||||
id: 'extensionSettings', label: 'Site and Extension options', icon: 'cogs',
|
||||
children: [
|
||||
{ id: 'default-extension-settings', label: 'Default settings' },
|
||||
{ id: 'website-extension-list', label: 'Website settings', },
|
||||
]
|
||||
},
|
||||
'siteSettings': {id: 'extensionSettings', label: 'Site and Extension options', icon: 'cogs' },
|
||||
'settings.player-element-settings': { id: 'settings.player-element-settings', label: 'Advanced video player options', icon: 'play-box-edit-outline' },
|
||||
'window.player-element-settings': { id: 'window.player-element-settings', label: 'Advanced video player options', icon: 'play-box-edit-outline' },
|
||||
@ -229,7 +235,7 @@ const AVAILABLE_TABS = {
|
||||
'keyboardShortcuts': {id: 'keyboardShortcuts', label: 'Keyboard shortcuts', icon: 'keyboard-outline' },
|
||||
'playerDetection': {id: 'playerDetection', label: 'Player detection', icon: 'television-play'},
|
||||
|
||||
'installed': { id: 'updated', label: 'Update completed', icon: 'monitor-arrow-down-variant'},
|
||||
'installed': { id: 'installed', label: 'Update completed', icon: 'monitor-arrow-down-variant'},
|
||||
'updated': { id: 'updated', label: 'Update completed', icon: 'update'},
|
||||
|
||||
'changelog': {id: 'changelog', label: 'What\'s new', icon: 'alert-decagram' },
|
||||
@ -240,7 +246,7 @@ const AVAILABLE_TABS = {
|
||||
|
||||
const TAB_LOADOUT = {
|
||||
'settings': [
|
||||
'extensionSettings',
|
||||
'extension-settings',
|
||||
'settings.player-element-settings',
|
||||
'autodetectionSettings',
|
||||
'ui-settings',
|
||||
@ -299,6 +305,7 @@ export default defineComponent({
|
||||
BrowserDetect: BrowserDetect,
|
||||
preventClose: false,
|
||||
siteSettings: null,
|
||||
globalSettings: null,
|
||||
}
|
||||
},
|
||||
props: [
|
||||
@ -336,6 +343,7 @@ export default defineComponent({
|
||||
changelogTab.highlight = !this.settings.active?.whatsNewChecked;
|
||||
}
|
||||
|
||||
this.globalSettings = this.settings.getSiteSettings({site: '@global'});
|
||||
if (this.site) {
|
||||
this.siteSettings = this.settings.getSiteSettings({site: this.site});
|
||||
}
|
||||
@ -377,6 +385,7 @@ export default defineComponent({
|
||||
console.warn('[uw:SettingsWindowContent] tab', tab, 'is not present in available tabs:', AVAILABLE_TABS, '— tabs for role', this.role, TAB_LOADOUT[this.role]);
|
||||
continue;
|
||||
} else {
|
||||
console.log('pushing tab:', tab, AVAILABLE_TABS[tab])
|
||||
tabs.push(AVAILABLE_TABS[tab]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -310,13 +310,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<pre>
|
||||
SITE SETTINGS: raw
|
||||
{{JSON.stringify(siteSettings.raw)}}
|
||||
|
||||
SITE SETTINGS: data
|
||||
{{JSON.stringify(siteSettings.data)}}
|
||||
</pre>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -546,28 +539,7 @@ export default defineComponent({
|
||||
|
||||
setExtensionMode(component, event) {
|
||||
const option = event.target.value;
|
||||
|
||||
console.log('set extension mode - we received option', option, 'for component', component);
|
||||
|
||||
return;
|
||||
if (option === 'complex') {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (component === 'enable' && !this.isDefaultConfiguration) {
|
||||
this.setExtensionMode('enableAard', event);
|
||||
this.setExtensionMode('enableKeyboard', event);
|
||||
|
||||
// in enableUI, 'enabled' is unused and 'theater' uses its place
|
||||
if (option === 'enabled') {
|
||||
this.setExtensionMode('enableUI', {target: {value: 'theater'}});
|
||||
} else {
|
||||
this.setExtensionMode('enableUI', event);
|
||||
}
|
||||
}
|
||||
|
||||
this.siteSettings.set(component, option);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user