aboutsummaryrefslogtreecommitdiff
path: root/packages/demobank-ui/src/context/pageState.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/demobank-ui/src/context/pageState.ts')
-rw-r--r--packages/demobank-ui/src/context/pageState.ts21
1 files changed, 10 insertions, 11 deletions
diff --git a/packages/demobank-ui/src/context/pageState.ts b/packages/demobank-ui/src/context/pageState.ts
index fd7a6c90c..d5428b9b7 100644
--- a/packages/demobank-ui/src/context/pageState.ts
+++ b/packages/demobank-ui/src/context/pageState.ts
@@ -14,6 +14,7 @@
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
+import { TranslatedString } from "@gnu-taler/taler-util";
import { useNotNullLocalStorage } from "@gnu-taler/web-util/lib/index.browser";
import { ComponentChildren, createContext, h, VNode } from "preact";
import { StateUpdater, useContext } from "preact/hooks";
@@ -29,7 +30,6 @@ export type Type = {
};
const initial: Type = {
pageState: {
- isRawPayto: false,
withdrawalInProgress: false,
},
pageStateSetter: () => {
@@ -58,7 +58,6 @@ export const PageStateProvider = ({
*/
function usePageState(
state: PageStateType = {
- isRawPayto: false,
withdrawalInProgress: false,
},
): [PageStateType, StateUpdater<PageStateType>] {
@@ -92,24 +91,24 @@ function usePageState(
return [retObj, removeLatestInfo];
}
+export type ErrorMessage = {
+ description?: string;
+ title: TranslatedString;
+ debug?: string;
+}
/**
* Track page state.
*/
export interface PageStateType {
- isRawPayto: boolean;
- withdrawalInProgress: boolean;
- error?: {
- description?: string;
- title: string;
- debug?: string;
- };
+ error?: ErrorMessage;
+ info?: TranslatedString;
- info?: string;
+ withdrawalInProgress: boolean;
talerWithdrawUri?: string;
/**
* Not strictly a presentational value, could
* be moved in a future "withdrawal state" object.
*/
withdrawalId?: string;
- timestamp?: number;
+
}