Skip to content

Commit 08a73e3

Browse files
authored
feat: remove supported-platforms feature gate (#2335)
## Summary This PR removes the `supported-platforms` feature flag, enabling all network platforms by default in the wallet selection drawer. ## Changes ### `packages/keychain/src/components/purchasenew/checkout/onchain/wallet-drawer.tsx` - Removed the `isSupportedPlatformsEnabled` feature flag hook call - Updated `selectedNetworks` useMemo to always include all platforms: starknet, ethereum, base, arbitrum, and optimism - Removed `isSupportedPlatformsEnabled` from the dependency array - Minor formatting improvements ### `packages/keychain/src/hooks/features.tsx` - Removed `supported-platforms` from the `Feature` type union ## Result All network platforms are now always available in the wallet selection drawer without requiring feature flag enablement.
1 parent 170e397 commit 08a73e3

File tree

2 files changed

+11
-18
lines changed

2 files changed

+11
-18
lines changed

packages/keychain/src/components/purchasenew/checkout/onchain/wallet-drawer.tsx

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export function WalletSelectionDrawer({
3131
isOpen,
3232
onClose,
3333
}: WalletSelectionDrawerProps) {
34-
const isSupportedPlatformsEnabled = useFeature("supported-platforms");
3534
const isApplePayEnabled = useFeature("apple-pay-support");
3635

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

5453
const selectedNetworks = useMemo(() => {
55-
const platforms = isSupportedPlatformsEnabled
56-
? "starknet;ethereum;base;arbitrum;optimism"
57-
: "starknet";
58-
59-
let networks =
60-
platforms
61-
?.split(";")
62-
.map((platform) =>
63-
networkWalletData.networks.find((n) => n.platform === platform),
64-
)
65-
.filter(Boolean) || [];
54+
const platforms = isMainnet
55+
? ["starknet", "ethereum", "base", "arbitrum", "optimism"]
56+
: ["starknet"];
57+
58+
let networks = platforms
59+
.map((platform) =>
60+
networkWalletData.networks.find((n) => n.platform === platform),
61+
)
62+
.filter(Boolean);
6663

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

8077
return networks as Network[];
81-
}, [starterpackDetails, isSupportedPlatformsEnabled]);
78+
}, [isMainnet, starterpackDetails]);
8279

8380
// Reset state when drawer closes
8481
useEffect(() => {

packages/keychain/src/hooks/features.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ import React, {
1010

1111
const LOCAL_STORAGE_KEY = "@cartridge/features";
1212

13-
export type Feature =
14-
| "none"
15-
| "connections"
16-
| "supported-platforms"
17-
| "apple-pay-support";
13+
export type Feature = "none" | "connections" | "apple-pay-support";
1814

1915
// --- Helper Functions ---
2016

0 commit comments

Comments
 (0)