aboutsummaryrefslogtreecommitdiff
path: root/packages/demobank-ui/src/components/Cashouts/state.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/demobank-ui/src/components/Cashouts/state.ts')
-rw-r--r--packages/demobank-ui/src/components/Cashouts/state.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/demobank-ui/src/components/Cashouts/state.ts b/packages/demobank-ui/src/components/Cashouts/state.ts
index 124f9bf9c..47ad0a297 100644
--- a/packages/demobank-ui/src/components/Cashouts/state.ts
+++ b/packages/demobank-ui/src/components/Cashouts/state.ts
@@ -14,18 +14,19 @@
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
+import { TalerError } from "@gnu-taler/taler-util";
import { useCashouts } from "../../hooks/circuit.js";
import { Props, State } from "./index.js";
export function useComponentState({ account, onSelected }: Props): State {
const result = useCashouts(account);
- if (result.loading) {
+ if (!result) {
return {
status: "loading",
error: undefined,
};
}
- if (!result.ok) {
+ if (result instanceof TalerError) {
return {
status: "loading-error",
error: result,
@@ -35,7 +36,7 @@ export function useComponentState({ account, onSelected }: Props): State {
return {
status: "ready",
error: undefined,
- cashouts: result.data,
+ cashouts: result.body.cashouts,
onSelected,
};
}