Don't incorrectly set websites as user-defined just because initial player index was set
This commit is contained in:
parent
6ea47d26d0
commit
aef5665cb5
@ -314,6 +314,7 @@ export interface SiteSettingsInterface {
|
|||||||
enableKeyboard: ExtensionEnvironmentSettingsInterface;
|
enableKeyboard: ExtensionEnvironmentSettingsInterface;
|
||||||
enableUI: ExtensionEnvironmentSettingsInterface; // Lies! enableUI doesn't use 'theater' property (but uses the other two)
|
enableUI: ExtensionEnvironmentSettingsInterface; // Lies! enableUI doesn't use 'theater' property (but uses the other two)
|
||||||
|
|
||||||
|
autocreated?: boolean;
|
||||||
type?: 'official' | 'community' | 'user-defined' | 'testing' | 'officially-disabled' | 'unknown' | 'modified';
|
type?: 'official' | 'community' | 'user-defined' | 'testing' | 'officially-disabled' | 'unknown' | 'modified';
|
||||||
defaultType: 'official' | 'community' | 'user-defined' | 'testing' | 'officially-disabled' | 'unknown' | 'modified';
|
defaultType: 'official' | 'community' | 'user-defined' | 'testing' | 'officially-disabled' | 'unknown' | 'modified';
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
is geoblocked.
|
is geoblocked.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="siteSupportLevel === 'no-support'" class="site-support no-support">
|
<div v-if="siteSupportLevel === 'no-support' || siteSupportLevel === 'unknown'" class="site-support no-support">
|
||||||
<mdicon name="help-circle-outline" />
|
<mdicon name="help-circle-outline" />
|
||||||
<div v-if="!small">Unknown</div>
|
<div v-if="!small">Unknown</div>
|
||||||
<div class="tooltip">
|
<div class="tooltip">
|
||||||
|
@ -307,10 +307,18 @@ export class SiteSettings {
|
|||||||
* @param optionValue new value of option
|
* @param optionValue new value of option
|
||||||
* @param reload whether we should trigger a reload in components that require it
|
* @param reload whether we should trigger a reload in components that require it
|
||||||
*/
|
*/
|
||||||
async set(optionPath: string, optionValue: any, options: {reload?: boolean, noSave?: boolean} = {reload: false}) {
|
async set(optionPath: string, optionValue: any, options: {reload?: boolean, noSave?: boolean, scripted?: boolean} = {reload: false}) {
|
||||||
// if no settings exist for this site, create an empty object
|
// if no settings exist for this site, create an empty object.
|
||||||
if (!this.settings.active.sites[this.site]) {
|
// If this function is not being called in response to user actin,
|
||||||
this.settings.active.sites[this.site] = _cp(this.settings.active.sites['@empty']);
|
// create fake settings object.
|
||||||
|
if (options.scripted && !this.settings.active.sites[this.site]) {
|
||||||
|
this.settings.active.sites[this.site] = _cp(this.settings.active.sites['@global']);
|
||||||
|
this.settings.active.sites[this.site].autocreated = true;
|
||||||
|
this.settings.active.sites[this.site].type = 'unknown';
|
||||||
|
} else {
|
||||||
|
if (!this.settings.active.sites[this.site] || this.settings.active.sites[this.site].autocreated) {
|
||||||
|
this.settings.active.sites[this.site] = _cp(this.settings.active.sites['@empty']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const pathParts = optionPath.split('.');
|
const pathParts = optionPath.split('.');
|
||||||
|
@ -718,7 +718,7 @@ class PlayerData {
|
|||||||
} else {
|
} else {
|
||||||
bestCandidate.heuristics['autoMatch'] = true;
|
bestCandidate.heuristics['autoMatch'] = true;
|
||||||
if (this.siteSettings.data.playerAutoConfig?.initialIndex !== bestCandidate.index) {
|
if (this.siteSettings.data.playerAutoConfig?.initialIndex !== bestCandidate.index) {
|
||||||
this.siteSettings.set('playerAutoConfig.initialIndex', bestCandidate.index, {reload: false});
|
this.siteSettings.set('playerAutoConfig.initialIndex', bestCandidate.index, {reload: false, scripted: true});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user