Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export function WalletSelectionDrawer({
isOpen,
onClose,
}: WalletSelectionDrawerProps) {
const isSupportedPlatformsEnabled = useFeature("supported-platforms");
const isApplePayEnabled = useFeature("apple-pay-support");

const { isMainnet, externalDetectWallets } = useConnection();
Expand All @@ -52,17 +51,15 @@ export function WalletSelectionDrawer({
>(new Map());

const selectedNetworks = useMemo(() => {
const platforms = isSupportedPlatformsEnabled
? "starknet;ethereum;base;arbitrum;optimism"
: "starknet";

let networks =
platforms
?.split(";")
.map((platform) =>
networkWalletData.networks.find((n) => n.platform === platform),
)
.filter(Boolean) || [];
const platforms = isMainnet
? ["starknet", "ethereum", "base", "arbitrum", "optimism"]
: ["starknet"];

let networks = platforms
.map((platform) =>
networkWalletData.networks.find((n) => n.platform === platform),
)
.filter(Boolean);

// If acquisition type is claimed, filter networks to only show those with merkle drop support
if (starterpackDetails?.type === "claimed") {
Expand All @@ -78,7 +75,7 @@ export function WalletSelectionDrawer({
}

return networks as Network[];
}, [starterpackDetails, isSupportedPlatformsEnabled]);
}, [isMainnet, starterpackDetails]);

// Reset state when drawer closes
useEffect(() => {
Expand Down
6 changes: 1 addition & 5 deletions packages/keychain/src/hooks/features.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ import React, {

const LOCAL_STORAGE_KEY = "@cartridge/features";

export type Feature =
| "none"
| "connections"
| "supported-platforms"
| "apple-pay-support";
export type Feature = "none" | "connections" | "apple-pay-support";

// --- Helper Functions ---

Expand Down
Loading