diff options
author | Sebastian <sebasjm@gmail.com> | 2023-10-26 15:26:58 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-10-26 15:26:58 -0300 |
commit | c19aa60d3687260d01404f94e0902fe1943f16df (patch) | |
tree | 027723116667ad0a9f22a92ff472f41b0947da7c /packages/taler-wallet-webextension/src/wallet/Settings.tsx | |
parent | a4c7bc4b284fe7dc4c65ceaad96fc67c40c9a708 (diff) | |
download | wallet-core-c19aa60d3687260d01404f94e0902fe1943f16df.tar.xz |
first take on adding auto open again, WIP
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/Settings.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/Settings.tsx | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/Settings.tsx b/packages/taler-wallet-webextension/src/wallet/Settings.tsx index 45a6db5df..2319fe30a 100644 --- a/packages/taler-wallet-webextension/src/wallet/Settings.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Settings.tsx @@ -73,6 +73,14 @@ export function SettingsPage(): VNode { deviceName={name} setDeviceName={update} autoOpenToggle={{ + value: settings.autoOpenByHeader, + button: { + onClick: safely("update support injection", async () => { + updateSettings("autoOpenByHeader", !settings.autoOpenByHeader); + }), + }, + }} + injectTalerToggle={{ value: settings.injectTalerSupport, button: { onClick: safely("update support injection", async () => { @@ -109,6 +117,7 @@ export interface ViewProps { deviceName: string; setDeviceName: (s: string) => Promise<void>; autoOpenToggle: ToggleHandler; + injectTalerToggle: ToggleHandler; advanceToggle: ToggleHandler; langToggle: ToggleHandler; knownExchanges: Array<ExchangeListItem>; @@ -122,6 +131,7 @@ export interface ViewProps { export function SettingsView({ knownExchanges, autoOpenToggle, + injectTalerToggle, advanceToggle, langToggle, coreVersion, @@ -207,7 +217,23 @@ export function SettingsView({ <i18n.Translate>Add an exchange</i18n.Translate> </LinkPrimary> </div> - + <EnabledBySettings name="advanceMode"> + <SubTitle> + <i18n.Translate>Navigator</i18n.Translate> + </SubTitle> + <Checkbox + label={i18n.str`Automatically open wallet based on page content`} + name="autoOpen" + description={ + <i18n.Translate> + Enabling this option below will make using the wallet faster, + but requires more permissions from your browser. + </i18n.Translate> + } + enabled={autoOpenToggle.value!} + onToggle={autoOpenToggle.button.onClick!} + /> + </EnabledBySettings> {coreVersion && (<Fragment> {LibtoolVersion.compare(coreVersion.version, WALLET_CORE_SUPPORTED_VERSION)?.compatible ? undefined : @@ -276,8 +302,8 @@ export function SettingsView({ open the wallet using the keyboard shortcut </i18n.Translate> } - enabled={autoOpenToggle.value!} - onToggle={autoOpenToggle.button.onClick!} + enabled={injectTalerToggle.value!} + onToggle={injectTalerToggle.button.onClick!} /> <SubTitle> <i18n.Translate>Version</i18n.Translate> |