diff options
author | Sebastian <sebasjm@gmail.com> | 2023-06-20 11:18:37 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-06-20 11:18:55 -0300 |
commit | 773712419e7663f62a3c529b7743dd6964f0879a (patch) | |
tree | d3f43b0283e63bfd09abccb297d0e03d9eb69858 | |
parent | e5a8ae7d60c9fc9d6740ef391ac34f2ac620b0f4 (diff) |
log notification from wallet
4 files changed, 5 insertions, 24 deletions
diff --git a/packages/taler-wallet-webextension/src/platform/api.ts b/packages/taler-wallet-webextension/src/platform/api.ts index 49108fa63..2537b16c2 100644 --- a/packages/taler-wallet-webextension/src/platform/api.ts +++ b/packages/taler-wallet-webextension/src/platform/api.ts @@ -18,6 +18,7 @@ import { CoreApiResponse, NotificationType, TalerUri, + WalletNotification, } from "@gnu-taler/taler-util"; import { WalletConfig, @@ -60,9 +61,7 @@ export interface CrossBrowserPermissionsApi { ): void; } -export type MessageFromBackend = { - type: NotificationType; -}; +export type MessageFromBackend = WalletNotification; export type MessageFromFrontend< Op extends BackgroundOperations | WalletOperations | ExtensionOperations, diff --git a/packages/taler-wallet-webextension/src/wallet/DestinationSelection/index.ts b/packages/taler-wallet-webextension/src/wallet/DestinationSelection/index.ts index e0f5869ff..7724ec2be 100644 --- a/packages/taler-wallet-webextension/src/wallet/DestinationSelection/index.ts +++ b/packages/taler-wallet-webextension/src/wallet/DestinationSelection/index.ts @@ -75,7 +75,6 @@ export namespace State { goToBank: ButtonHandler; goToWallet: ButtonHandler; amountHandler: AmountFieldHandler; - mode: ToggleHandler; } } diff --git a/packages/taler-wallet-webextension/src/wallet/DestinationSelection/state.ts b/packages/taler-wallet-webextension/src/wallet/DestinationSelection/state.ts index 41831a78a..e42b1dbf9 100644 --- a/packages/taler-wallet-webextension/src/wallet/DestinationSelection/state.ts +++ b/packages/taler-wallet-webextension/src/wallet/DestinationSelection/state.ts @@ -47,8 +47,6 @@ export function useComponentState(props: Props): RecursiveState<State> { const [amount, setAmount] = useState( !parsedInitialAmount ? undefined : parsedInitialAmount, ); - const [rawMode, setRawMode] = useState(false); - //FIXME: get this information from wallet // eslint-disable-next-line no-constant-condition const previous: Contact[] = true @@ -119,14 +117,6 @@ export function useComponentState(props: Props): RecursiveState<State> { return { status: "ready", error: undefined, - mode: { - button: { - onClick: pushAlertOnError(async () => { - setRawMode(!rawMode); - }), - }, - value: rawMode, - }, previous, selectCurrency: { onClick: pushAlertOnError(async () => { @@ -166,14 +156,6 @@ export function useComponentState(props: Props): RecursiveState<State> { status: "ready", error: undefined, previous, - mode: { - button: { - onClick: pushAlertOnError(async () => { - setRawMode(!rawMode); - }), - }, - value: rawMode, - }, selectCurrency: { onClick: pushAlertOnError(async () => { setAmount(undefined); diff --git a/packages/taler-wallet-webextension/src/wxBackend.ts b/packages/taler-wallet-webextension/src/wxBackend.ts index 57d4add1c..dfdb1b0d5 100644 --- a/packages/taler-wallet-webextension/src/wxBackend.ts +++ b/packages/taler-wallet-webextension/src/wxBackend.ts @@ -28,6 +28,7 @@ import { Logger, TalerErrorCode, WalletDiagnostics, + WalletNotification, getErrorDetailFromException, makeErrorDetail, setGlobalLogLevelFromString, @@ -342,8 +343,8 @@ async function reinitWallet(): Promise<void> { walletInit.reject(e); return; } - wallet.addNotificationListener((x) => { - const message: MessageFromBackend = { type: x.type }; + wallet.addNotificationListener((message) => { + logger.info("wallet -> ui", message); platform.sendMessageToAllChannels(message); }); |