diff --git a/ext/src/_locales/en/messages.json b/ext/src/_locales/en/messages.json index 2418ef4..ed4a99d 100755 --- a/ext/src/_locales/en/messages.json +++ b/ext/src/_locales/en/messages.json @@ -415,5 +415,9 @@ "optionsSaved": { "message": "Saved!", "description": "Status text displayed by save button once options have been successfully saved." + }, + "optionsShowAdvancedOptions": { + "message": "Show advanced options", + "description": "Show advanced options checkbox label." } } diff --git a/ext/src/defaultOptions.ts b/ext/src/defaultOptions.ts index 8eb2fbe..2759693 100644 --- a/ext/src/defaultOptions.ts +++ b/ext/src/defaultOptions.ts @@ -19,6 +19,7 @@ export interface Options { siteWhitelistEnabled: boolean; siteWhitelist: WhitelistItemData[]; siteWhitelistCustomUserAgent: string; + showAdvancedOptions: boolean; [key: string]: Options[keyof Options]; } @@ -39,5 +40,6 @@ export default { receiverSelectorWaitForConnection: true, siteWhitelistEnabled: true, siteWhitelist: [{ pattern: "https://www.netflix.com/*" }], - siteWhitelistCustomUserAgent: "" + siteWhitelistCustomUserAgent: "", + showAdvancedOptions: false } as Options; diff --git a/ext/src/ui/options/Options.svelte b/ext/src/ui/options/Options.svelte index 4ece5f4..874f82c 100644 --- a/ext/src/ui/options/Options.svelte +++ b/ext/src/ui/options/Options.svelte @@ -68,13 +68,19 @@ } function resetForm() { - opts = JSON.parse(JSON.stringify(defaultOptions)); + if (!opts) return; + + opts = { + ...JSON.parse(JSON.stringify(defaultOptions)), + // Retain advanced options shown state + showAdvancedOptions: opts.showAdvancedOptions + }; } {#if opts}