Merge Global settings and Stream settings into one dialog

This commit is contained in:
redphx
2024-07-27 16:09:13 +07:00
parent 023799232e
commit 9dfdeb8f12
76 changed files with 3281 additions and 2466 deletions

View File

@@ -1,5 +1,4 @@
import { UserAgentProfile } from "@enums/user-agent";
import { deepClone } from "./global";
import { BX_FLAGS } from "./bx-flags";
type UserAgentConfig = {
@@ -48,14 +47,14 @@ export class UserAgent {
}
static updateStorage(profile: UserAgentProfile, custom?: string) {
const clonedConfig = deepClone(UserAgent.#config);
clonedConfig.profile = profile;
const config = UserAgent.#config;
config.profile = profile;
if (typeof custom !== 'undefined') {
clonedConfig.custom = custom;
if (profile === UserAgentProfile.CUSTOM && typeof custom !== 'undefined') {
config.custom = custom;
}
window.localStorage.setItem(UserAgent.STORAGE_KEY, JSON.stringify(clonedConfig));
window.localStorage.setItem(UserAgent.STORAGE_KEY, JSON.stringify(config));
}
static getDefault(): string {