From 9ae921864435b149714a8c5f68c85ef86c2adf53 Mon Sep 17 00:00:00 2001 From: Karolina Kosiorowska Date: Wed, 4 Dec 2024 12:11:37 +0100 Subject: [PATCH] Add comment: why activities are stored in redux --- dapp/src/store/wallet/walletSlice.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dapp/src/store/wallet/walletSlice.ts b/dapp/src/store/wallet/walletSlice.ts index 4da460562..ff480fae3 100644 --- a/dapp/src/store/wallet/walletSlice.ts +++ b/dapp/src/store/wallet/walletSlice.ts @@ -5,6 +5,12 @@ export type WalletState = { estimatedBtcBalance: bigint sharesBalance: bigint isSignedMessage: boolean + // Activities are saved in redux because the Acre subgraph may or may not be + // up to date with the chain. As a result, if we fetch data from Acre SDK + // after the withdrawal is initiated, we may not yet see this activity. + // Storing activities in redux gives us the option to add activities manually + // by `activityInitialized`. However, fetching the activity from the Acre SDK + // again later should already return us the updated data. activities: Activity[] address: string | undefined }