Skip to content

Commit c117c18

Browse files
committed
feat(suite-native): release connect popup and walletConnect for ios
1 parent e6c2322 commit c117c18

File tree

11 files changed

+40
-89
lines changed

11 files changed

+40
-89
lines changed

suite-native/app/e2e/utils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const INITIAL_LAUNCH_ARGS: LaunchArgumentsWithPreloadedState = {
2020
// Main loop synchronization is infinitely blocking iOS tests while is the graph displayed, so we need to disable it.
2121
// Not sure about the cause of it yet.
2222
DTXDisableMainRunLoopSync: platform === 'ios',
23-
isConnectPopupEnabled_v2: true,
2423
isDebugKeysAllowed: true,
2524
isTradingBuyEnabled: true,
2625
areDebugOnlyNetworksEnabled: true,

suite-native/app/src/initActions.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
} from '@suite-common/wallet-core';
1313
import { walletConnectInitThunk } from '@suite-common/walletconnect';
1414
import { initAnalyticsThunk } from '@suite-native/analytics';
15-
import { FeatureFlag, selectIsFeatureFlagEnabled } from '@suite-native/feature-flags';
1615
import { initNativeLocalFirstStorageThunk } from '@suite-native/local-first-storage';
1716
import { setIsAppReady } from '@suite-native/state/src/appSlice';
1817

@@ -56,9 +55,7 @@ export const postOnboardingInit = createThunk(
5655
// Create Portfolio Tracker device if it doesn't exist
5756
dispatch(createImportedDeviceThunk());
5857

59-
if (selectIsFeatureFlagEnabled(getState(), FeatureFlag.IsWalletConnectEnabled)) {
60-
dispatch(walletConnectInitThunk());
61-
}
58+
dispatch(walletConnectInitThunk());
6259

6360
dispatch(initNativeLocalFirstStorageThunk());
6461
},

suite-native/config/src/launch-arguments.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ export type LaunchArguments = {
55
DTXDisableMainRunLoopSync?: boolean;
66
isBluetoothEnabled?: boolean;
77
isCardanoSendEnabled?: boolean;
8-
isConnectPopupEnabled_v2?: boolean;
98
isDebugKeysAllowed?: boolean;
10-
isWalletConnectEnabled_v2?: boolean;
119
isTradingBuyEnabled?: boolean;
1210
isTradingExchangeEnabled?: boolean;
1311
isTradingSellEnabled?: boolean;

suite-native/feature-flags/src/__tests__/featureFlagsSlice.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ describe('featureFlagsSlice', () => {
2020
isBluetoothEnabled: false,
2121
areDebugOnlyNetworksEnabled: false,
2222
isCardanoSendEnabled: false,
23-
isConnectPopupEnabled_v2: true,
2423
isDebugKeysAllowed: false,
25-
isWalletConnectEnabled_v2: true,
2624
isLocalFirstStorageEnabled: false,
2725
isTradingBuyEnabled: false,
2826
isTradingExchangeEnabled: false,
@@ -47,9 +45,7 @@ describe('featureFlagsSlice', () => {
4745
isBluetoothEnabled: false,
4846
areDebugOnlyNetworksEnabled: false,
4947
isCardanoSendEnabled: false,
50-
isConnectPopupEnabled_v2: false,
5148
isDebugKeysAllowed: false,
52-
isWalletConnectEnabled_v2: false,
5349
isLocalFirstStorageEnabled: false,
5450
isTradingBuyEnabled: false,
5551
isTradingExchangeEnabled: false,

suite-native/feature-flags/src/featureFlagsSlice.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ export const FeatureFlag = {
77
IsBluetoothEnabled: 'isBluetoothEnabled',
88
AreDebugOnlyNetworksEnabled: 'areDebugOnlyNetworksEnabled',
99
IsCardanoSendEnabled: 'isCardanoSendEnabled',
10-
IsConnectPopupEnabled: 'isConnectPopupEnabled_v2', // v2: after changing default value for Android
1110
IsDebugKeysAllowed: 'isDebugKeysAllowed',
12-
IsWalletConnectEnabled: 'isWalletConnectEnabled_v2', // v2: after changing default value for Android
1311
IsTradingBuyEnabled: 'isTradingBuyEnabled',
1412
IsTradingExchangeEnabled: 'isTradingExchangeEnabled',
1513
IsTradingSellEnabled: 'isTradingSellEnabled',
@@ -35,13 +33,7 @@ export const featureFlagsInitialState: FeatureFlagsState = {
3533
process.env.EXPO_PUBLIC_FF_ARE_DEBUG_ONLY_NETWORKS_ENABLED === 'true',
3634
[FeatureFlag.IsCardanoSendEnabled]:
3735
process.env.EXPO_PUBLIC_FF_IS_CARDANO_SEND_ENABLED === 'true',
38-
[FeatureFlag.IsConnectPopupEnabled]:
39-
process.env.EXPO_PUBLIC_FF_IS_CONNECT_POPUP_ENABLED === 'true' ||
40-
(isAndroid() && process.env.EXPO_PUBLIC_FF_IS_CONNECT_POPUP_ENABLED !== 'false'),
4136
[FeatureFlag.IsDebugKeysAllowed]: process.env.EXPO_PUBLIC_FF_IS_DEBUG_KEYS_ALLOWED === 'true',
42-
[FeatureFlag.IsWalletConnectEnabled]:
43-
process.env.EXPO_PUBLIC_FF_IS_WALLET_CONNECT_ENABLED === 'true' ||
44-
(isAndroid() && process.env.EXPO_PUBLIC_FF_IS_WALLET_CONNECT_ENABLED !== 'false'),
4537
[FeatureFlag.IsTradingBuyEnabled]: process.env.EXPO_PUBLIC_FF_IS_TRADING_BUY_ENABLED === 'true',
4638
[FeatureFlag.IsTradingExchangeEnabled]:
4739
process.env.EXPO_PUBLIC_FF_IS_TRADING_SWAP_ENABLED === 'true',
@@ -60,8 +52,6 @@ export const featureFlagsPersistedKeys: Array<keyof FeatureFlagsState> = [
6052
FeatureFlag.IsBluetoothEnabled,
6153
FeatureFlag.AreDebugOnlyNetworksEnabled,
6254
FeatureFlag.IsCardanoSendEnabled,
63-
FeatureFlag.IsConnectPopupEnabled,
64-
FeatureFlag.IsWalletConnectEnabled,
6555
FeatureFlag.IsTradingBuyEnabled,
6656
FeatureFlag.IsTradingExchangeEnabled,
6757
FeatureFlag.IsTradingSellEnabled,

suite-native/module-connect-popup/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"@suite-native/config": "workspace:*",
2727
"@suite-native/device": "workspace:*",
2828
"@suite-native/device-manager": "workspace:*",
29-
"@suite-native/feature-flags": "workspace:^",
3029
"@suite-native/helpers": "workspace:^",
3130
"@suite-native/icons": "workspace:^",
3231
"@suite-native/intl": "workspace:^",

suite-native/module-connect-popup/src/hooks/useConnectPopupNavigation.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import * as Linking from 'expo-linking';
77
import { connectPopupDeeplinkThunk, selectConnectPopupCall } from '@suite-common/connect-popup';
88
import { selectPendingProposal, walletConnectPairThunk } from '@suite-common/walletconnect';
99
import { isDevelopOrDebugEnv } from '@suite-native/config';
10-
import { FeatureFlag, useFeatureFlag } from '@suite-native/feature-flags';
1110
import {
1211
RootStackParamList,
1312
RootStackRoutes,
@@ -36,8 +35,6 @@ const isWalletConnectUrl = (url: string): boolean => url.startsWith('trezorsuite
3635
// TODO: will be necessary to handle if device is not connected/unlocked so we probably want to wait until user unlock device
3736
// we already have some modals like biometrics or coin enabled which are waiting for device to be connected
3837
export const useConnectPopupNavigation = () => {
39-
const featureFlagEnabled = useFeatureFlag(FeatureFlag.IsConnectPopupEnabled);
40-
const featureFlagWalletConnectEnabled = useFeatureFlag(FeatureFlag.IsWalletConnectEnabled);
4138
const navigation = useNavigation<NavigationProp>();
4239
const dispatch = useDispatch();
4340
const connectPopupCall = useSelector(selectConnectPopupCall);
@@ -48,9 +45,9 @@ export const useConnectPopupNavigation = () => {
4845
const url = Linking.useURL();
4946

5047
useEffect(() => {
51-
if (featureFlagEnabled && url && isConnectPopupUrl(url)) {
48+
if (url && isConnectPopupUrl(url)) {
5249
dispatch(connectPopupDeeplinkThunk({ url }));
53-
} else if (featureFlagWalletConnectEnabled && url && isWalletConnectUrl(url)) {
50+
} else if (url && isWalletConnectUrl(url)) {
5451
try {
5552
const parsedUrl = new URL(url);
5653
const wcUri = parsedUrl?.searchParams?.get('uri');
@@ -59,7 +56,7 @@ export const useConnectPopupNavigation = () => {
5956
// Malformed url, ignore
6057
}
6158
}
62-
}, [url, featureFlagEnabled, featureFlagWalletConnectEnabled, dispatch]);
59+
}, [url, dispatch]);
6360

6461
useEffect(() => {
6562
if (connectPopupCall?.state === 'deeplink-callback') {

suite-native/module-connect-popup/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
{ "path": "../config" },
3535
{ "path": "../device" },
3636
{ "path": "../device-manager" },
37-
{ "path": "../feature-flags" },
3837
{ "path": "../helpers" },
3938
{ "path": "../icons" },
4039
{ "path": "../intl" },

suite-native/module-dev-utils/src/components/FeatureFlags.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ const featureFlagsTitleMap = {
1717
[FeatureFlagEnum.IsBluetoothEnabled]: 'Bluetooth',
1818
[FeatureFlagEnum.AreDebugOnlyNetworksEnabled]: '🧪 Debug only networks',
1919
[FeatureFlagEnum.IsCardanoSendEnabled]: 'Cardano send',
20-
[FeatureFlagEnum.IsConnectPopupEnabled]: 'Connect Popup',
2120
[FeatureFlagEnum.IsDebugKeysAllowed]: 'Device Auth Check Debug Keys',
22-
[FeatureFlagEnum.IsWalletConnectEnabled]: 'WalletConnect',
2321
[FeatureFlagEnum.IsTradingBuyEnabled]: '💰 Trading Buy',
2422
[FeatureFlagEnum.IsTradingExchangeEnabled]: '💰 Trading Swap',
2523
[FeatureFlagEnum.IsTradingSellEnabled]: '💰 Trading Sell',

suite-native/module-settings/src/components/ConnectionSettings.tsx

Lines changed: 35 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
TitledSection,
1313
useBottomSheetModal,
1414
} from '@suite-native/atoms';
15-
import { FeatureFlag, useFeatureFlag } from '@suite-native/feature-flags';
1615
import { Icon } from '@suite-native/icons';
1716
import { Translation } from '@suite-native/intl';
1817
import { WalletConnectPairBottomSheet } from '@suite-native/module-connect-popup';
@@ -25,72 +24,52 @@ import {
2524
import { AppSettingsCardWithIconLayout } from './AppSettingsCardWithIconLayout';
2625

2726
export const ConnectionSettings = () => {
28-
const isConnectPopupEnabled = useFeatureFlag(FeatureFlag.IsConnectPopupEnabled);
29-
const isWalletConnectEnabled = useFeatureFlag(FeatureFlag.IsWalletConnectEnabled);
3027
const { bottomSheetRef, openModal, closeModal } = useBottomSheetModal();
3128

3229
const navigation = useNavigation<StackNavigationProps<RootStackParamList, RootStackRoutes>>();
3330

34-
if (!isConnectPopupEnabled && !isWalletConnectEnabled) {
35-
return null;
36-
}
37-
3831
return (
3932
<TitledSection title={<Translation id="moduleSettings.items.connections.title" />}>
4033
<Card noPadding>
41-
{isWalletConnectEnabled && (
42-
<AppSettingsCardWithIconLayout
43-
icon="walletConnect"
44-
title={
45-
<Translation id="moduleSettings.items.connections.walletConnect.title" />
46-
}
47-
onPress={() => navigation.navigate(RootStackRoutes.WalletConnectPair)}
48-
testID="@settings/wallet-connect"
49-
borderColor={null}
50-
noShadow
51-
/>
52-
)}
53-
{isWalletConnectEnabled && (
54-
<>
55-
<CardDivider />
56-
<Box paddingHorizontal="sp16" paddingVertical="sp12">
57-
<WalletConnectPairBottomSheet
58-
ref={bottomSheetRef}
59-
onClose={closeModal}
60-
/>
61-
<TouchableOpacity
62-
onPress={openModal}
63-
testID="@settings/wallet-connect-add"
64-
>
65-
<HStack justifyContent="space-between" alignItems="center">
66-
<HStack spacing="sp16" alignItems="center">
67-
<RoundedIcon
68-
name="qrCode"
69-
color="iconPrimaryDefault"
70-
backgroundColor="backgroundPrimarySubtleOnElevation0"
71-
iconSize="mediumLarge"
72-
/>
73-
<Text color="textPrimaryDefault">
74-
<Translation id="moduleSettings.items.connections.walletConnect.add" />
75-
</Text>
76-
</HStack>
77-
<Icon name="plus" color="textSecondaryHighlight" />
78-
</HStack>
79-
</TouchableOpacity>
80-
</Box>
81-
</>
82-
)}
83-
</Card>
84-
{isConnectPopupEnabled && (
8534
<AppSettingsCardWithIconLayout
86-
icon="trezorLogo"
35+
icon="walletConnect"
8736
title={
88-
<Translation id="moduleSettings.items.connections.trezorConnect.title" />
37+
<Translation id="moduleSettings.items.connections.walletConnect.title" />
8938
}
90-
onPress={() => navigation.navigate(RootStackRoutes.ConnectPermissions)}
91-
testID="@settings/connect-permissions"
39+
onPress={() => navigation.navigate(RootStackRoutes.WalletConnectPair)}
40+
testID="@settings/wallet-connect"
41+
borderColor={null}
42+
noShadow
9243
/>
93-
)}
44+
45+
<CardDivider />
46+
<Box paddingHorizontal="sp16" paddingVertical="sp12">
47+
<WalletConnectPairBottomSheet ref={bottomSheetRef} onClose={closeModal} />
48+
<TouchableOpacity onPress={openModal} testID="@settings/wallet-connect-add">
49+
<HStack justifyContent="space-between" alignItems="center">
50+
<HStack spacing="sp16" alignItems="center">
51+
<RoundedIcon
52+
name="qrCode"
53+
color="iconPrimaryDefault"
54+
backgroundColor="backgroundPrimarySubtleOnElevation0"
55+
iconSize="mediumLarge"
56+
/>
57+
<Text color="textPrimaryDefault">
58+
<Translation id="moduleSettings.items.connections.walletConnect.add" />
59+
</Text>
60+
</HStack>
61+
<Icon name="plus" color="textSecondaryHighlight" />
62+
</HStack>
63+
</TouchableOpacity>
64+
</Box>
65+
</Card>
66+
67+
<AppSettingsCardWithIconLayout
68+
icon="trezorLogo"
69+
title={<Translation id="moduleSettings.items.connections.trezorConnect.title" />}
70+
onPress={() => navigation.navigate(RootStackRoutes.ConnectPermissions)}
71+
testID="@settings/connect-permissions"
72+
/>
9473
</TitledSection>
9574
);
9675
};

0 commit comments

Comments
 (0)