Skip to content

Commit a672589

Browse files
committed
refactor: improve type safety for bot signers in new wallet component
- Updated the type annotation for the `addBotAsSigner` function to use the `BotWithAddress` type, enhancing type safety and clarity in the new wallet component. - Imported the `BotWithAddress` type from the SignersCard module to ensure consistent type usage across the component.
1 parent 1facdc3 commit a672589

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • src/components/pages/homepage/wallets/new-wallet

src/components/pages/homepage/wallets/new-wallet/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ import type { RawImportBodies } from "@/types/wallet";
1313

1414
import PageHeader from "@/components/common/page-header";
1515
import WalletInfoCard from "@/components/pages/homepage/wallets/new-wallet/nWInfoCard";
16-
import SignersCard from "@/components/pages/homepage/wallets/new-wallet/nWSignersCard";
16+
import SignersCard, {
17+
type BotWithAddress,
18+
} from "@/components/pages/homepage/wallets/new-wallet/nWSignersCard";
1719
import AdvancedOptionsCard from "@/components/pages/homepage/wallets/new-wallet/nWAdvancedOptionsCard";
1820
import WalletActionButtons from "@/components/pages/homepage/wallets/new-wallet/nWActionButtons";
1921
import InspectMultisigScript from "@/components/multisig/inspect-multisig-script";
@@ -170,7 +172,7 @@ export default function PageNewWallet() {
170172
!!k.botUser?.paymentAddress,
171173
);
172174

173-
function addBotAsSigner(bot: (typeof botsWithAddress)[number]) {
175+
function addBotAsSigner(bot: BotWithAddress) {
174176
const addr = bot.botUser.paymentAddress;
175177
if (signersAddresses.includes(addr)) return;
176178
setSignerAddresses([...signersAddresses, addr]);

0 commit comments

Comments
 (0)