log notification from wallet
This commit is contained in:
parent
e5a8ae7d60
commit
773712419e
@ -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,
|
||||
|
@ -75,7 +75,6 @@ export namespace State {
|
||||
goToBank: ButtonHandler;
|
||||
goToWallet: ButtonHandler;
|
||||
amountHandler: AmountFieldHandler;
|
||||
mode: ToggleHandler;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user