Skip to content

Commit a4d29d4

Browse files
authored
update deploy result for transfers and add refetch time for the single deploy (#1065)
1 parent 3111d1f commit a4d29d4

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

src/apps/popup/pages/deploy-details/components/deploy-details-result.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,12 @@ export const DeployDetailsResult = ({ deploy }: DeployDetailsResultProps) => {
9090
key={id}
9191
callerAccountInfo={action.callerAccountInfo}
9292
recipientAccountInfo={action.recipientAccountInfo}
93-
toPublicKey={action.recipientKey}
94-
fromPublicKey={action.callerPublicKey}
93+
toPublicKey={
94+
action.recipientKey || action.recipientAccountInfo?.accountHash!
95+
}
96+
fromPublicKey={
97+
action.callerPublicKey || action.callerAccountInfo?.accountHash!
98+
}
9599
fiatAmount={action.fiatAmount}
96100
/>
97101
))}

src/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export const ACCOUNT_DEPLOY_REFRESH_RATE = 30 * SECOND;
1313
export const ACCOUNT_CASPER_ACTIVITY_REFRESH_RATE = 30 * SECOND;
1414
export const ERC20_TOKEN_ACTIVITY_REFRESH_RATE = 30 * SECOND;
1515
export const VALIDATORS_REFRESH_RATE = 30 * SECOND;
16+
export const PENDING_DEPLOY_REFETCH_INTERVAL = 5 * SECOND;
17+
export const DEPLOY_DETAILS_REFRESH_RATE = 30 * SECOND;
1618

1719
export const LOGIN_RETRY_ATTEMPTS_LIMIT = 5;
1820
export const ERROR_DISPLAYED_BEFORE_ATTEMPT_IS_DECREMENTED = 1;
@@ -27,8 +29,6 @@ export const STAKE_COST_MOTES = '2500000000'; // 2.5 CSPR
2729
export const DELEGATION_MIN_AMOUNT_MOTES = '500000000000'; // 500 CSPR
2830
export const MAX_DELEGATORS = 1200;
2931

30-
export const PENDING_DEPLOY_REFETCH_INTERVAL = 5 * 1000;
31-
3232
export const getBlockExplorerAccountUrl = (
3333
casperLiveUrl: string,
3434
publicKey: string

src/libs/services/deploys/use-fetch-single-deploy.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { useQuery } from '@tanstack/react-query';
22
import { CasperNetwork } from 'casper-wallet-core/src/domain/common/common';
33
import { useSelector } from 'react-redux';
44

5+
import { DEPLOY_DETAILS_REFRESH_RATE } from '@src/constants';
6+
57
import { selectActiveNetworkSetting } from '@background/redux/settings/selectors';
68
import { selectVaultActiveAccount } from '@background/redux/vault/selectors';
79
import { deploysRepository } from '@background/wallet-repositories';
@@ -17,7 +19,9 @@ export const useFetchSingleDeploy = (deployHash?: string) => {
1719
deployHash: deployHash ?? '',
1820
activePublicKey: activeAccount?.publicKey ?? '',
1921
network: network.toLowerCase() as CasperNetwork
20-
})
22+
}),
23+
refetchInterval: DEPLOY_DETAILS_REFRESH_RATE,
24+
staleTime: DEPLOY_DETAILS_REFRESH_RATE
2125
});
2226

2327
return {

0 commit comments

Comments
 (0)