-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor+fix: ledger app name check (#2797)
* fix: InstallLedgerView icons * refactor: ledger app name check * fix: pr comments Co-authored-by: Jean Ribeiro <[email protected]> --------- Co-authored-by: Nicole O'Brien <[email protected]>
- Loading branch information
1 parent
4155fb4
commit 05f471d
Showing
15 changed files
with
75 additions
and
74 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
10 changes: 3 additions & 7 deletions
10
...ages/desktop/views/onboarding/views/complete-onboarding/views/FinishOnboardingView.svelte
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
13 changes: 3 additions & 10 deletions
13
packages/desktop/views/onboarding/views/create-from-ledger/views/ConnectLedgerView.svelte
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
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
9 changes: 2 additions & 7 deletions
9
packages/shared/src/lib/core/ledger/actions/checkOrConnectLedger.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
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
8 changes: 2 additions & 6 deletions
8
packages/shared/src/lib/core/ledger/utils/isLedgerDeviceMatchingActiveProfile.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
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
10 changes: 3 additions & 7 deletions
10
packages/shared/src/lib/core/profile/actions/active-profile/checkActiveProfileAuth.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
23 changes: 23 additions & 0 deletions
23
packages/shared/src/lib/core/profile/actions/active-profile/getProfileLedgerAppName.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,23 @@ | ||
import { IOnboardingProfile, onboardingProfile } from '@contexts/onboarding' | ||
import { LedgerAppName } from '@core/ledger' | ||
import { get } from 'svelte/store' | ||
import { SupportedStardustNetworkId } from '@core/network' | ||
import { IProfile } from '@core/profile/interfaces' | ||
import { activeProfile } from '@core/profile/stores' | ||
|
||
export function getProfileLedgerAppName( | ||
profile: IProfile | Partial<IOnboardingProfile> = get(onboardingProfile) ?? get(activeProfile) | ||
): LedgerAppName { | ||
const networkId = profile?.network?.id | ||
|
||
switch (networkId) { | ||
case SupportedStardustNetworkId.Iota: | ||
case SupportedStardustNetworkId.IotaTestnet: | ||
return LedgerAppName.Iota | ||
case SupportedStardustNetworkId.Shimmer: | ||
case SupportedStardustNetworkId.Testnet: | ||
return LedgerAppName.Shimmer | ||
default: | ||
throw new Error(`Unsupported network id: ${networkId}`) | ||
} | ||
} |
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