summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-02-22 12:32:05 +0100
committerFlorian Dold <florian@dold.me>2024-02-22 12:32:05 +0100
commit012ba47d0bf669c258d703606a09c5d48922a58f (patch)
treeb38e54e482c1c22e646bd14fb87268d8142fad00
parent3b5c5f4a9d55cec9db2687f81042cedeb6f6321f (diff)
downloadwallet-core-012ba47d0bf669c258d703606a09c5d48922a58f.tar.gz
wallet-core-012ba47d0bf669c258d703606a09c5d48922a58f.tar.bz2
wallet-core-012ba47d0bf669c258d703606a09c5d48922a58f.zip
webextension: mvp for force-reloading exchange entries
-rw-r--r--packages/taler-wallet-webextension/src/wallet/Settings.tsx87
1 files changed, 56 insertions, 31 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/Settings.tsx b/packages/taler-wallet-webextension/src/wallet/Settings.tsx
index 03e4dc64a..19b30dd5f 100644
--- a/packages/taler-wallet-webextension/src/wallet/Settings.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/Settings.tsx
@@ -129,11 +129,13 @@ export function SettingsView({
}: ViewProps): VNode {
const { i18n, lang, supportedLang, changeLanguage } = useTranslationContext();
+ const api = useBackendContext();
+
return (
<Fragment>
<section>
<SubTitle>
- <i18n.Translate>Trust</i18n.Translate>
+ <i18n.Translate>Exchange Entries</i18n.Translate>
</SubTitle>
{!knownExchanges || !knownExchanges.length ? (
<div>
@@ -151,7 +153,10 @@ export function SettingsView({
<i18n.Translate>URL</i18n.Translate>
</th>
<th>
- <i18n.Translate>Term of Service</i18n.Translate>
+ <i18n.Translate>Terms of Service</i18n.Translate>
+ </th>
+ <th>
+ <i18n.Translate>Actions</i18n.Translate>
</th>
</tr>
</thead>
@@ -172,9 +177,7 @@ export function SettingsView({
</WarningText>
);
case ExchangeTosStatus.Proposed:
- return (
- <i18n.Translate>proposed</i18n.Translate>
- );
+ return <i18n.Translate>proposed</i18n.Translate>;
default:
return (
<DestructiveText>
@@ -194,6 +197,22 @@ export function SettingsView({
<td>
<Status />
</td>
+ <td>
+ <button
+ onClick={() => {
+ console.log(`force-updating ${e.exchangeBaseUrl}`);
+ api.wallet.call(
+ WalletApiOperation.UpdateExchangeEntry,
+ {
+ exchangeBaseUrl: e.exchangeBaseUrl,
+ force: true,
+ },
+ );
+ }}
+ >
+ Reload
+ </button>
+ </td>
</tr>
);
})}
@@ -208,32 +227,38 @@ export function SettingsView({
</LinkPrimary>
</div>
- {coreVersion && (<Fragment>
- {LibtoolVersion.compare(coreVersion.version, WALLET_CORE_SUPPORTED_VERSION)?.compatible ? undefined :
- <WarningBox>
- <i18n.Translate>
- The version of wallet core is not supported. (supported version: {WALLET_CORE_SUPPORTED_VERSION})
- </i18n.Translate>
- </WarningBox>}
- <EnabledBySettings name="advanceMode">
- <Part
- title={i18n.str`Exchange compatibility`}
- text={<span>{coreVersion.exchange}</span>}
- />
- <Part
- title={i18n.str`Merchant compatibility`}
- text={<span>{coreVersion.merchant}</span>}
- />
- <Part
- title={i18n.str`Bank compatibility`}
- text={<span>{coreVersion.bank}</span>}
- />
- <Part
- title={i18n.str`Wallet Core compatibility`}
- text={<span>{coreVersion.version}</span>}
- />
- </EnabledBySettings>
- </Fragment>
+ {coreVersion && (
+ <Fragment>
+ {LibtoolVersion.compare(
+ coreVersion.version,
+ WALLET_CORE_SUPPORTED_VERSION,
+ )?.compatible ? undefined : (
+ <WarningBox>
+ <i18n.Translate>
+ The version of wallet core is not supported. (supported
+ version: {WALLET_CORE_SUPPORTED_VERSION})
+ </i18n.Translate>
+ </WarningBox>
+ )}
+ <EnabledBySettings name="advanceMode">
+ <Part
+ title={i18n.str`Exchange compatibility`}
+ text={<span>{coreVersion.exchange}</span>}
+ />
+ <Part
+ title={i18n.str`Merchant compatibility`}
+ text={<span>{coreVersion.merchant}</span>}
+ />
+ <Part
+ title={i18n.str`Bank compatibility`}
+ text={<span>{coreVersion.bank}</span>}
+ />
+ <Part
+ title={i18n.str`Wallet Core compatibility`}
+ text={<span>{coreVersion.version}</span>}
+ />
+ </EnabledBySettings>
+ </Fragment>
)}
<SubTitle>
<i18n.Translate>Advance mode</i18n.Translate>