Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(LIVE-17351): swap LLM prevent scrolling nav conflict #9367

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/few-dryers-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"live-mobile": minor
---

Remove gesture handler for swipe back in LLM swap
24 changes: 3 additions & 21 deletions apps/ledger-live-mobile/src/screens/Swap/LiveApp/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,7 @@ import {
import { LiveAppManifest } from "@ledgerhq/live-common/platform/types";
import { useLocalLiveAppManifest } from "@ledgerhq/live-common/wallet-api/LocalLiveAppProvider/index";
import { Flex, InfiniteLoader } from "@ledgerhq/native-ui";
import { useNavigation } from "@react-navigation/core";
import { useTranslation } from "react-i18next";
import {
HandlerStateChangeEvent,
PanGestureHandler,
PanGestureHandlerEventPayload,
State,
} from "react-native-gesture-handler";
import GenericErrorView from "~/components/GenericErrorView";
import { initialWebviewState } from "~/components/Web3AppWebview/helpers";
import { WebviewState } from "~/components/Web3AppWebview/types";
Expand Down Expand Up @@ -51,15 +44,6 @@ export function SwapLiveApp() {

const manifest: LiveAppManifest | undefined = !localManifest ? remoteManifest : localManifest;

const navigation = useNavigation();

const onGesture = (event: HandlerStateChangeEvent<PanGestureHandlerEventPayload>) => {
// PanGestureHandler callback for swiping left to right to fix issue with <Tab.Navigator>
if (event.nativeEvent.state === State.END && event.nativeEvent.translationX > 10) {
navigation.goBack();
}
};

if (!manifest || isWebviewError) {
return (
<Flex flex={1} justifyContent="center" alignItems="center">
Expand All @@ -75,10 +59,8 @@ export function SwapLiveApp() {
}

return (
<PanGestureHandler onHandlerStateChange={onGesture} activeOffsetX={[0, 10]}>
<Flex flex={1} testID="swap-form-tab">
<WebView manifest={manifest} setWebviewState={setWebviewState} />
</Flex>
</PanGestureHandler>
<Flex flex={1} testID="swap-form-tab">
<WebView manifest={manifest} setWebviewState={setWebviewState} />
</Flex>
);
}