Skip to content

Commit 289710b

Browse files
committed
Migrate to Lens v3
1 parent 8cf84f5 commit 289710b

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

apps/web/src/components/Settings/Manager/AccountManager/AddAccountManager.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ import { Errors } from "@hey/data/errors";
66
import selfFundedTransactionData from "@hey/helpers/selfFundedTransactionData";
77
import sponsoredTransactionData from "@hey/helpers/sponsoredTransactionData";
88
import { useAddAccountManagerMutation } from "@hey/indexer";
9+
import { OptmisticTransactionType } from "@hey/types/enums";
910
import { Button } from "@hey/ui";
1011
import type { Dispatch, FC, SetStateAction } from "react";
1112
import { useState } from "react";
1213
import toast from "react-hot-toast";
1314
import { useAccountStatus } from "src/store/non-persisted/useAccountStatus";
1415
import { useAccountStore } from "src/store/persisted/useAccountStore";
16+
import { addSimpleOptimisticTransaction } from "src/store/persisted/useTransactionStore";
1517
import { isAddress } from "viem";
1618
import { sendEip712Transaction, sendTransaction } from "viem/zksync";
1719
import { useWalletClient } from "wagmi";
@@ -38,7 +40,10 @@ const AddAccountManager: FC<AddAccountManagerProps> = ({
3840
const onCompleted = (hash: string) => {
3941
setIsLoading(false);
4042
setShowAddManagerModal(false);
41-
toast.success(hash);
43+
addSimpleOptimisticTransaction(
44+
hash,
45+
OptmisticTransactionType.AddAccountManager
46+
);
4247
toast.success("Account manager added");
4348
};
4449

apps/web/src/components/Settings/Manager/AccountManager/Managers/List.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ import {
1313
useAccountManagersQuery,
1414
useRemoveAccountManagerMutation
1515
} from "@hey/indexer";
16+
import { OptmisticTransactionType } from "@hey/types/enums";
1617
import { Button, EmptyState, ErrorMessage } from "@hey/ui";
1718
import type { FC } from "react";
1819
import { useState } from "react";
1920
import toast from "react-hot-toast";
2021
import { Virtuoso } from "react-virtuoso";
2122
import { useAccountStatus } from "src/store/non-persisted/useAccountStatus";
2223
import { useAccountStore } from "src/store/persisted/useAccountStore";
24+
import { addSimpleOptimisticTransaction } from "src/store/persisted/useTransactionStore";
2325
import { sendEip712Transaction, sendTransaction } from "viem/zksync";
2426
import { useWalletClient } from "wagmi";
2527

@@ -52,7 +54,10 @@ const List: FC = () => {
5254
const onCompleted = (hash: string) => {
5355
setRemovingAddress(null);
5456
updateCache(hash);
55-
toast.success(hash);
57+
addSimpleOptimisticTransaction(
58+
hash,
59+
OptmisticTransactionType.RemoveAccountManager
60+
);
5661
toast.success("Manager removed successfully");
5762
};
5863

0 commit comments

Comments
 (0)