Skip to content

Commit

Permalink
fix(suite-native): ignore unknown URL schemes by connect popup
Browse files Browse the repository at this point in the history
  • Loading branch information
yanascz committed Oct 2, 2024
1 parent 99cacda commit b8fa537
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ type NavigationProp = StackToStackCompositeNavigationProps<
RootStackParamList
>;

const isConnectPopupUrl = (url: string): boolean => url.startsWith('trezorsuitelite://');

// TODO: will be necessary to handle if device is not connected/unlocked so we probably want to wait until user unlock device
// we already have some modals like biometrics or coin enabled which are waiting for device to be connected
export const useConnectPopupNavigation = () => {
Expand All @@ -31,7 +33,7 @@ export const useConnectPopupNavigation = () => {
useEffect(() => {
const navigateToInitalUrl = async () => {
const currentUrl = await Linking.getInitialURL();
if (currentUrl) {
if (currentUrl && isConnectPopupUrl(currentUrl)) {
// eslint-disable-next-line no-console
console.log('initial url', currentUrl);
navigateToConnectPopup(currentUrl);
Expand Down

0 comments on commit b8fa537

Please sign in to comment.