File tree 2 files changed +12
-2
lines changed
apps/web/src/components/Settings/Manager/AccountManager
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -6,12 +6,14 @@ import { Errors } from "@hey/data/errors";
6
6
import selfFundedTransactionData from "@hey/helpers/selfFundedTransactionData" ;
7
7
import sponsoredTransactionData from "@hey/helpers/sponsoredTransactionData" ;
8
8
import { useAddAccountManagerMutation } from "@hey/indexer" ;
9
+ import { OptmisticTransactionType } from "@hey/types/enums" ;
9
10
import { Button } from "@hey/ui" ;
10
11
import type { Dispatch , FC , SetStateAction } from "react" ;
11
12
import { useState } from "react" ;
12
13
import toast from "react-hot-toast" ;
13
14
import { useAccountStatus } from "src/store/non-persisted/useAccountStatus" ;
14
15
import { useAccountStore } from "src/store/persisted/useAccountStore" ;
16
+ import { addSimpleOptimisticTransaction } from "src/store/persisted/useTransactionStore" ;
15
17
import { isAddress } from "viem" ;
16
18
import { sendEip712Transaction , sendTransaction } from "viem/zksync" ;
17
19
import { useWalletClient } from "wagmi" ;
@@ -38,7 +40,10 @@ const AddAccountManager: FC<AddAccountManagerProps> = ({
38
40
const onCompleted = ( hash : string ) => {
39
41
setIsLoading ( false ) ;
40
42
setShowAddManagerModal ( false ) ;
41
- toast . success ( hash ) ;
43
+ addSimpleOptimisticTransaction (
44
+ hash ,
45
+ OptmisticTransactionType . AddAccountManager
46
+ ) ;
42
47
toast . success ( "Account manager added" ) ;
43
48
} ;
44
49
Original file line number Diff line number Diff line change @@ -13,13 +13,15 @@ import {
13
13
useAccountManagersQuery ,
14
14
useRemoveAccountManagerMutation
15
15
} from "@hey/indexer" ;
16
+ import { OptmisticTransactionType } from "@hey/types/enums" ;
16
17
import { Button , EmptyState , ErrorMessage } from "@hey/ui" ;
17
18
import type { FC } from "react" ;
18
19
import { useState } from "react" ;
19
20
import toast from "react-hot-toast" ;
20
21
import { Virtuoso } from "react-virtuoso" ;
21
22
import { useAccountStatus } from "src/store/non-persisted/useAccountStatus" ;
22
23
import { useAccountStore } from "src/store/persisted/useAccountStore" ;
24
+ import { addSimpleOptimisticTransaction } from "src/store/persisted/useTransactionStore" ;
23
25
import { sendEip712Transaction , sendTransaction } from "viem/zksync" ;
24
26
import { useWalletClient } from "wagmi" ;
25
27
@@ -52,7 +54,10 @@ const List: FC = () => {
52
54
const onCompleted = ( hash : string ) => {
53
55
setRemovingAddress ( null ) ;
54
56
updateCache ( hash ) ;
55
- toast . success ( hash ) ;
57
+ addSimpleOptimisticTransaction (
58
+ hash ,
59
+ OptmisticTransactionType . RemoveAccountManager
60
+ ) ;
56
61
toast . success ( "Manager removed successfully" ) ;
57
62
} ;
58
63
You can’t perform that action at this time.
0 commit comments