From ce462f3ad2f7a44053ffb3957ed8db6e9cf8c4ce Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Wed, 31 Jul 2024 18:59:16 +0530 Subject: [PATCH] Remove path config used for deep links --- src/index.tsx | 9 +-------- src/screens/SignRequest.tsx | 23 +++++++---------------- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 61d2d7c..087f562 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -15,14 +15,7 @@ import { WalletConnectProvider } from './context/WalletConnectContext'; globalThis.Buffer = Buffer; const linking = { - prefixes: ['https://wallet.laconic.com'], - config: { - screens: { - SignRequest: { - path: 'sign/:namespace/:chaindId/:address/:message', - }, - }, - }, + prefixes: ['https://wallet.laconic.com'] }; const theme = { diff --git a/src/screens/SignRequest.tsx b/src/screens/SignRequest.tsx index 4775797..3e0839d 100644 --- a/src/screens/SignRequest.tsx +++ b/src/screens/SignRequest.tsx @@ -1,7 +1,6 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { Image, ScrollView, View } from 'react-native'; import { ActivityIndicator, Button, Text, Appbar } from 'react-native-paper'; -import _ from 'lodash'; import { useNavigation } from '@react-navigation/native'; import { @@ -50,7 +49,7 @@ const SignRequest = ({ route }: SignRequestProps) => { const isCosmosSignDirect = useMemo(() => { const requestParams = route.params.requestEvent; - if (!requestParams) { + if (!requestParams?.id) { return false; } @@ -60,7 +59,7 @@ const SignRequest = ({ route }: SignRequestProps) => { const isEthSendTransaction = useMemo(() => { const requestParams = route.params.requestEvent; - if (!requestParams) { + if (!requestParams?.id) { return false; } @@ -87,21 +86,13 @@ const SignRequest = ({ route }: SignRequestProps) => { return; } - if (_.isEqual(requestAccount, account)) { - setAccount(requestAccount); - } - if (requestMessage !== message) { - setMessage(decodeURIComponent(requestMessage)); - } - if (requestNamespace !== namespace) { - setNamespace(requestNamespace); - } - if (requestChainId !== chainId) { - setChainId(requestChainId); - } + setAccount(requestAccount); + setMessage(decodeURIComponent(requestMessage)); + setNamespace(requestNamespace); + setChainId(requestChainId); setIsLoading(false); }, - [account, message, navigation, namespace, chainId], + [navigation], ); const sanitizePath = useCallback(