@@ -5,25 +5,23 @@ import { sourceAssetAtom } from "@/state/swapPage";
5
5
import { PageHeader } from "../../components/PageHeader" ;
6
6
import { currentPageAtom , Routes } from "@/state/router" ;
7
7
import { ConnectedWalletContent } from "./ConnectedWalletContent" ;
8
- import { lastTransactionHasCompletedAtom , transactionHistoryAtom } from "@/state/history" ;
8
+ import { isFetchingLastTransactionStatusAtom , transactionHistoryAtom } from "@/state/history" ;
9
9
import { track } from "@amplitude/analytics-browser" ;
10
10
import { SpinnerIcon } from "@/icons/SpinnerIcon" ;
11
11
import { useGetAccount } from "@/hooks/useGetAccount" ;
12
12
import { useTxHistory } from "@/hooks/useTxHistory" ;
13
- import { skipSubmitSwapExecutionAtom } from "@/state/swapExecutionPage" ;
14
13
15
14
export const SwapPageHeader = memo ( ( ) => {
16
15
const setCurrentPage = useSetAtom ( currentPageAtom ) ;
17
16
const sourceAsset = useAtomValue ( sourceAssetAtom ) ;
18
- const { isPending } = useAtomValue ( skipSubmitSwapExecutionAtom ) ;
19
17
20
- const lastTransactionHasCompleted = useAtomValue ( lastTransactionHasCompletedAtom ) ;
18
+ const isFetchingLastTransactionStatus = useAtomValue ( isFetchingLastTransactionStatusAtom ) ;
21
19
22
20
const getAccount = useGetAccount ( ) ;
23
21
const sourceAccount = getAccount ( sourceAsset ?. chainID ) ;
24
22
25
23
const historyPageIcon = useMemo ( ( ) => {
26
- if ( ! lastTransactionHasCompleted || isPending ) {
24
+ if ( isFetchingLastTransactionStatus ) {
27
25
return (
28
26
< div
29
27
style = { {
@@ -45,10 +43,10 @@ export const SwapPageHeader = memo(() => {
45
43
}
46
44
47
45
return ICONS . history ;
48
- } , [ isPending , lastTransactionHasCompleted ] ) ;
46
+ } , [ isFetchingLastTransactionStatus ] ) ;
49
47
50
48
const historyPageButton = useMemo ( ( ) => {
51
- if ( lastTransactionHasCompleted === undefined ) return ;
49
+ if ( isFetchingLastTransactionStatus === undefined ) return ;
52
50
53
51
return {
54
52
label : "History" ,
@@ -58,7 +56,7 @@ export const SwapPageHeader = memo(() => {
58
56
setCurrentPage ( Routes . TransactionHistoryPage ) ;
59
57
} ,
60
58
} ;
61
- } , [ lastTransactionHasCompleted , historyPageIcon , setCurrentPage ] ) ;
59
+ } , [ isFetchingLastTransactionStatus , historyPageIcon , setCurrentPage ] ) ;
62
60
63
61
return (
64
62
< >
0 commit comments