Skip to content

Commit d96c1f4

Browse files
authored
Merge pull request #999 from ambrosus/dev
Merge 'dev' into 'stage'
2 parents 39fcecc + 1966cd7 commit d96c1f4

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

src/appTypes/navigation/root.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export type RootStackParamsList = {
1414
Passcode: PasscodeParams | undefined;
1515
BarcodeScannerScreen: {
1616
onScanned: (data: string) => void;
17+
walletConnectEnabled?: boolean;
1718
};
1819
};
1920

src/features/wallet-assets/lib/hooks/use-barcode.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ export function useBarcode() {
104104
const onShowBarcodeContainer = useCallback(
105105
() =>
106106
navigation.navigate('BarcodeScannerScreen', {
107-
onScanned: onScannedAddress
107+
onScanned: onScannedAddress,
108+
walletConnectEnabled: true
108109
}),
109110
[navigation, onScannedAddress]
110111
);

src/features/wallet-connect/components/composite/wallet-approval-view/index.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,12 @@ import { styles } from './styles';
3232
export const WalletConnectApprovalView = () => {
3333
const { t } = useTranslation();
3434
const { wallet } = useWalletStore();
35-
const { proposal, setActiveSessions, setWalletConnectStep } =
36-
useWalletConnectContextSelector();
35+
const {
36+
proposal,
37+
setActiveSessions,
38+
walletConnectStep,
39+
setWalletConnectStep
40+
} = useWalletConnectContextSelector();
3741
const { onDismissWalletConnectBottomSheet } = useHandleBottomSheetActions();
3842

3943
const [isLoadingApprove, setIsLoadingApprove] = useState(false);
@@ -115,6 +119,10 @@ export const WalletConnectApprovalView = () => {
115119
throw error;
116120
} finally {
117121
setIsLoadingApprove(false);
122+
123+
if (walletConnectStep === CONNECT_VIEW_STEPS.CONNECT_ERROR) {
124+
onDismissWalletConnectBottomSheet();
125+
}
118126
}
119127
}
120128
}, [
@@ -123,7 +131,8 @@ export const WalletConnectApprovalView = () => {
123131
setActiveSessions,
124132
onDismissWalletConnectBottomSheet,
125133
onShowToastNotification,
126-
setWalletConnectStep
134+
setWalletConnectStep,
135+
walletConnectStep
127136
]);
128137

129138
const RenderFooterNode = useCallback(() => {

src/navigation/stacks/RootStack.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export const RootStack = () => {
3636
/>
3737
<Stack.Screen
3838
name="BarcodeScannerScreen"
39+
initialParams={{ walletConnectEnabled: false }}
3940
options={{
4041
presentation: 'fullScreenModal',
4142
animation: 'slide_from_bottom'

src/screens/BarcodeScanner/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const MOCK_ADDRESS = 'ethereum:0xF51452e37eEbf3226BcBB25FA4f9F570f176484e';
2727
export const BarcodeScannerScreen = ({ navigation, route }: Props) => {
2828
const { t } = useTranslation();
2929
const {
30-
params: { onScanned }
30+
params: { onScanned, walletConnectEnabled }
3131
} = route;
3232
const { top: topInset } = useSafeAreaInsets();
3333
const {
@@ -136,7 +136,7 @@ export const BarcodeScannerScreen = ({ navigation, route }: Props) => {
136136
<ScanSquare />
137137
</Camera>
138138
)}
139-
{isCameraVisible && (
139+
{isCameraVisible && walletConnectEnabled && (
140140
<View style={styles.footer}>
141141
<Row alignItems="center" style={styles.footerIconsRow}>
142142
<View style={styles.iconBox}>

0 commit comments

Comments
 (0)