diff --git a/govtool/frontend/src/context/pendingTransaction/usePendingTransaction.ts b/govtool/frontend/src/context/pendingTransaction/usePendingTransaction.ts index a2c5af53a..bd537754b 100644 --- a/govtool/frontend/src/context/pendingTransaction/usePendingTransaction.ts +++ b/govtool/frontend/src/context/pendingTransaction/usePendingTransaction.ts @@ -55,9 +55,10 @@ export const usePendingTransaction = ({ const fromLocalStorage = getItemFromLocalStorage( `${PENDING_TRANSACTION_KEY}_${stakeKey}` ); - setTransaction({ + if (!fromLocalStorage) setTransaction(null); + else setTransaction({ ...fromLocalStorage, - resourceId: fromLocalStorage?.resourceId ?? undefined, + resourceId: fromLocalStorage.resourceId ?? undefined, }); } }, [isEnabled, stakeKey]);