aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2022-11-04 12:13:19 -0300
committerSebastian <sebasjm@gmail.com>2022-11-04 12:13:19 -0300
commitd2e2c0198f88a3a6c756d7f3b1c3e4cabb833483 (patch)
tree402c6fb43d32bd83fefe53a7f205e4bdff3d7e35
parentf79bca0abbf82885117fa4da9f5c0f6044b79ffc (diff)
mutate balance cache when talerWithdrawUri changes
-rw-r--r--packages/demobank-ui/src/pages/home/index.tsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/demobank-ui/src/pages/home/index.tsx b/packages/demobank-ui/src/pages/home/index.tsx
index 2da48f3ab..6477e018d 100644
--- a/packages/demobank-ui/src/pages/home/index.tsx
+++ b/packages/demobank-ui/src/pages/home/index.tsx
@@ -2112,7 +2112,7 @@ function Account(Props: any): VNode {
const { accountLabel, backendState } = Props;
// Getting the bank account balance:
const endpoint = `access-api/accounts/${accountLabel}`;
- const { data, error } = useSWR(endpoint, {
+ const { data, error, mutate } = useSWR(endpoint, {
// refreshInterval: 0,
// revalidateIfStale: false,
// revalidateOnMount: false,
@@ -2123,6 +2123,10 @@ function Account(Props: any): VNode {
const { withdrawalInProgress, withdrawalId, isLoggedIn, talerWithdrawUri } =
pageState;
const i18n = useTranslator();
+ useEffect(() => {
+ mutate()
+ }, [talerWithdrawUri])
+
/**
* This part shows a list of transactions: with 5 elements by
* default and offers a "load more" button.