-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7017 from LedgerHQ/bugfix/DSDK-331-europa-crash-m…
…yledger [DSDK-331][LLD] Europa crash MyLedger "cannot ready properties of undefined reading 'dark'"
- Loading branch information
Showing
6 changed files
with
57 additions
and
10 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 @@ | ||
--- | ||
"ledger-live-desktop": patch | ||
--- | ||
|
||
Fix a crash with Europa in My Ledger when opening an app |
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 @@ | ||
--- | ||
"@ledgerhq/devices": patch | ||
--- | ||
|
||
Add type narrowing helper isDeviceModelId |
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
Binary file added
BIN
+19.8 KB
apps/ledger-live-desktop/src/renderer/screens/manager/assets/europa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,12 +1,14 @@ | ||
import { DeviceModelId } from "."; | ||
|
||
export function isDeviceModelId(val: string | undefined | null): val is DeviceModelId { | ||
if (!val) return false; | ||
return Object.values(DeviceModelId).includes(val as DeviceModelId); | ||
} | ||
|
||
export const stringToDeviceModelId = ( | ||
strDeviceModelId: string, | ||
defaultDeviceModelId: DeviceModelId, | ||
): DeviceModelId => { | ||
if (Object.values(DeviceModelId)?.includes(strDeviceModelId as DeviceModelId)) { | ||
return DeviceModelId[strDeviceModelId as DeviceModelId]; | ||
} | ||
|
||
return defaultDeviceModelId; | ||
if (!isDeviceModelId(strDeviceModelId)) return defaultDeviceModelId; | ||
return DeviceModelId[strDeviceModelId]; | ||
}; |