Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/fix-home-history-refresh' into t…
Browse files Browse the repository at this point in the history
…mp/20241206
  • Loading branch information
richardo2016x committed Dec 6, 2024
2 parents b991e17 + 2d1aa6d commit 91b70a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion apps/mobile/src/components2024/WordsMatrix/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const getStyle = createGetStyles2024(({ colors2024 }) => ({
borderWidth: 1,
borderColor: 'transparent',
backgroundColor: colors2024['neutral-bg-2'],
width: '48%',
width: '47%',
minWidth: 0,
borderRadius: 12,
flexShrink: 0,
Expand Down
17 changes: 5 additions & 12 deletions apps/mobile/src/screens/Home/MultiAddressHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,18 +201,11 @@ function MultiAddressHome(): JSX.Element {
if (!addresses.length) {
return;
}
const { pendingsLength, pendings } =
const { pendingsLength } =
transactionHistoryService.getPendingsAddresses(addresses);
console.debug('fetchHistory :', balanceCacheAccounts, pendings);
setPendingTxCount(pendingsLength);
if (pendingsLength) {
if (!timeRef.current) {
timeRef.current = setInterval(fetchHistory, 5000);
}
} else {
timeRef.current && clearInterval(timeRef.current);
timeRef.current = null;
}
timeRef.current && clearInterval(timeRef.current);
timeRef.current = pendingsLength ? setInterval(fetchHistory, 5000) : null;
}, [balanceCacheAccounts]);

const detectHasAccounts = useMemoizedFn(async () => {
Expand Down Expand Up @@ -241,7 +234,7 @@ function MultiAddressHome(): JSX.Element {
const { redirectAction } = await detectHasAccounts();
if (redirectAction) {
redirectAction();
} else if (!timeRef.current) {
} else {
fetchHistory();
}
})();
Expand Down Expand Up @@ -608,7 +601,7 @@ const getStyle = createGetStyles2024(({ colors2024, isLight }) => ({
backgroundColor: isLight
? colors2024['neutral-bg-1']
: colors2024['neutral-bg-2'],
width: '48%',
width: '47%',
minWidth: 0,
borderRadius: 18,
flexShrink: 0,
Expand Down

0 comments on commit 91b70a9

Please sign in to comment.