-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(llm): ledger sync navigation fixes
- Loading branch information
1 parent
e6b8cea
commit 168d767
Showing
6 changed files
with
51 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"live-mobile": patch | ||
--- | ||
|
||
LLM - Ledger sync small navigation fixes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
apps/ledger-live-mobile/src/newArch/features/WalletSync/hooks/useClose.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { useNavigation } from "@react-navigation/native"; | ||
import { useDispatch, useSelector } from "react-redux"; | ||
import { setFromLedgerSyncOnboarding } from "~/actions/settings"; | ||
import { BaseNavigatorStackParamList } from "~/components/RootNavigator/types/BaseNavigator"; | ||
import { | ||
RootNavigationComposite, | ||
StackNavigatorNavigation, | ||
} from "~/components/RootNavigator/types/helpers"; | ||
import { NavigatorName } from "~/const"; | ||
import { isFromLedgerSyncOnboardingSelector } from "~/reducers/settings"; | ||
|
||
export function useClose() { | ||
const navigationOnbarding = | ||
useNavigation<RootNavigationComposite<StackNavigatorNavigation<BaseNavigatorStackParamList>>>(); | ||
const isFromLedgerSyncOnboarding = useSelector(isFromLedgerSyncOnboardingSelector); | ||
const dispatch = useDispatch(); | ||
|
||
const close = () => { | ||
if (isFromLedgerSyncOnboarding) { | ||
dispatch(setFromLedgerSyncOnboarding(false)); | ||
} | ||
navigationOnbarding.replace(NavigatorName.Base, { | ||
screen: NavigatorName.Main, | ||
}); | ||
}; | ||
|
||
return close; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters