-
Notifications
You must be signed in to change notification settings - Fork 355
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
WIP: Live 1792: Synchronized onboarding logic #214
Closed
Closed
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
6651535
feat(llc/hw): extract onboarding state function
alexandremgo fd508af
feat(llm): sync onboarding logic and screen
alexandremgo 05fc5f7
feat(llm): WIP select a nano for sync onboarding
alexandremgo 3f4306f
chore(llm): isolate deep linking for already onboarded devices
alexandremgo 42c9d49
feat(llm): enable deep linking to onboarding steps
alexandremgo 3d36f57
feat(llc): up-to-date onboarding state extract
alexandremgo 87a11f7
feat(llc): extractOnboardingState does not return null
alexandremgo 9955aaa
feat(llc): onboarding state polling logic in a hook
alexandremgo dbb03c7
feat(llc): sync onboarding cli
alexandremgo 269e209
feat(llm): SyncOnboarding screen uses onboarding state polling hook
alexandremgo 28440e3
feat(llm): sync onboarding reacts to allowed and fatal errors
alexandremgo 7e8adec
chore(llc): enum types for seed phrasse and onboarding step
alexandremgo b6c6dba
feat(llc): timeout on request to device during polling
alexandremgo f453674
chore(llc): unit test for timeout feature
alexandremgo 87ac892
feat(llc): add being able to stop onboarding state polling
alexandremgo 36b3326
refactor(llc): split observable into a firmwareInfo and an allowedErr…
alexandremgo a96aed9
fix(llc): no any type for isAllowedOnboardingStatePollingError
alexandremgo 8d40a79
refactor(llc): Boolean() instead of !!
alexandremgo d69e116
feat(llc): getOnboardingStatePolling logic
alexandremgo 4aa4911
refactor(llc): useOnboardingStatePolling uses getOnboardingStatePolling
alexandremgo ec989ad
refactor(llc): SeedPhraseType in types/manager
alexandremgo 448911f
chore(llm): for QA & demo
alexandremgo e75cc11
chore(llm): config app_identifier on Fastfile
alexandremgo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,30 @@ | ||
import { | ||
getOnboardingStatePolling, | ||
OnboardingStatePollingResult, | ||
} from "@ledgerhq/live-common/lib/hw/getOnboardingStatePolling"; | ||
import { Observable } from "rxjs"; | ||
import { deviceOpt } from "../scan"; | ||
|
||
export default { | ||
description: "track the onboarding status of your device", | ||
args: [ | ||
{ | ||
name: "pollingPeriodMs", | ||
alias: "p", | ||
desc: "polling period in milliseconds", | ||
type: Number, | ||
}, | ||
deviceOpt, | ||
], | ||
job: ({ | ||
device, | ||
pollingPeriodMs, | ||
}: Partial<{ | ||
device: string; | ||
pollingPeriodMs: number; | ||
}>): Observable<OnboardingStatePollingResult | null> => | ||
getOnboardingStatePolling({ | ||
deviceId: device ?? "", | ||
pollingPeriodMs: pollingPeriodMs ?? 1000, | ||
}), | ||
}; |
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
30 changes: 30 additions & 0 deletions
30
apps/ledger-live-mobile/src/components/RootNavigator/SyncOnboardingNavigator.tsx
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,30 @@ | ||
import React from "react"; | ||
import { createStackNavigator } from "@react-navigation/stack"; | ||
import type { Device } from "@ledgerhq/live-common/lib/hw/actions/types"; | ||
import { ScreenName } from "../../const"; | ||
import { SyncOnboarding } from "../../screens/SyncOnboarding"; | ||
|
||
// TODO - https://reactnavigation.org/docs/typescript/ | ||
// With route type, do we still need https://github.com/LedgerHQ/ledger-live-mobile/blob/develop/src/const/navigation.js | ||
// ? Need to cast each name to be able to use the const and the navigator typing | ||
export type SyncOnboardingStackParamList = { | ||
SyncOnboardingWelcome: { pairedDevice: Device | null }; | ||
}; | ||
|
||
const Stack = createStackNavigator<SyncOnboardingStackParamList>(); | ||
|
||
export const SyncOnboardingNavigator = () => ( | ||
<Stack.Navigator | ||
screenOptions={{ | ||
headerShown: false, | ||
headerTitle: "", | ||
headerShadowVisible: false, | ||
}} | ||
> | ||
<Stack.Screen | ||
name={ScreenName.SyncOnboardingWelcome as "SyncOnboardingWelcome"} | ||
component={SyncOnboarding} | ||
initialParams={{ pairedDevice: null }} | ||
/> | ||
</Stack.Navigator> | ||
); |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was a fixed to be able to build iOS that Valentin told me to try -> as this PR won't be merged, i did not put any comment on it. But Valentin merged this fix on develop yesterday ;)