diff --git a/.changeset/grumpy-deers-develop.md b/.changeset/grumpy-deers-develop.md new file mode 100644 index 000000000000..9cac0b2feb8f --- /dev/null +++ b/.changeset/grumpy-deers-develop.md @@ -0,0 +1,5 @@ +--- +"ledger-live-desktop": patch +--- + +Fix existing custom lock screen not being recognized in My Ledger ("Add" displayed instead of "Change" and no option to delete the current lock screen picture) diff --git a/CODEOWNERS b/CODEOWNERS index 9a103bb5ac3a..fa6675e1f307 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -99,8 +99,9 @@ apps/ledger-live-mobile/src/newArch/features/Web3Hub/ @ledgerhq/wallet-api # Devices team apps/cli/src/commands/devices @ledgerhq/live-devices **/src/renderer/screens/manager/ @ledgerhq/live-devices -**/screens/CustomImage @ledgerhq/live-devices -**/components/CustomImage @ledgerhq/live-devices +**/screens/customImage @ledgerhq/live-devices +**/components/CustomImage @ledgerhq/live-devices +**/screens/CustomImage @ledgerhq/live-devices **/SyncOnboarding/** @ledgerhq/live-devices **/OnboardingAppInstall/** @ledgerhq/live-devices **/UpdateFirmwareModal/** @ledgerhq/live-devices diff --git a/apps/ledger-live-desktop/src/renderer/screens/customImage/Step1ChooseImage.tsx b/apps/ledger-live-desktop/src/renderer/screens/customImage/Step1ChooseImage.tsx index 71f544c415f2..4a9352c75c39 100644 --- a/apps/ledger-live-desktop/src/renderer/screens/customImage/Step1ChooseImage.tsx +++ b/apps/ledger-live-desktop/src/renderer/screens/customImage/Step1ChooseImage.tsx @@ -30,6 +30,7 @@ type Props = StepProps & { isShowingNftGallery?: boolean; setIsShowingNftGallery: (_: boolean) => void; loading?: boolean; + hasCustomLockScreen?: boolean; }; const defaultMediaTypes = ["original", "big", "preview"]; @@ -47,8 +48,15 @@ const extractNftBase64 = (metadata: NFTMetadata) => { }; const StepChooseImage: React.FC = props => { - const { loading, setLoading, onResult, onError, isShowingNftGallery, setIsShowingNftGallery } = - props; + const { + loading, + setLoading, + onResult, + onError, + isShowingNftGallery, + setIsShowingNftGallery, + hasCustomLockScreen, + } = props; const isMounted = useIsMounted(); const { t } = useTranslation(); const track = useTrack(); @@ -158,7 +166,7 @@ const StepChooseImage: React.FC = props => { }); }} /> - {lastSeenCustomImage?.size ? ( + {hasCustomLockScreen || lastSeenCustomImage?.size ? ( void; deviceModelId: DeviceModelId | null; + hasCustomLockScreen?: boolean; }; const orderedSteps: Step[] = [ @@ -55,8 +56,13 @@ const orderedSteps: Step[] = [ const ErrorDisplayV2 = withV2StyleProvider(ErrorDisplay); const CustomImage: React.FC = props => { - const { imageUri, isFromNFTEntryPoint, reopenPreviousDrawer, isFromPostOnboardingEntryPoint } = - props; + const { + imageUri, + isFromNFTEntryPoint, + reopenPreviousDrawer, + isFromPostOnboardingEntryPoint, + hasCustomLockScreen, + } = props; const { t } = useTranslation(); const track = useTrack(); const { setAnalyticsDrawerName } = useContext(analyticsDrawerContext); @@ -264,6 +270,7 @@ const CustomImage: React.FC = props => { setLoading={setSourceLoading} isShowingNftGallery={isShowingNftGallery} setIsShowingNftGallery={setIsShowingNftGallery} + hasCustomLockScreen={hasCustomLockScreen} /> { const { t } = useTranslation(); - const { disabled, deviceModelId } = props; - - const lastSeenCustomImage = useSelector(lastSeenCustomImageSelector); + const { disabled, deviceModelId, hasCustomLockScreen } = props; const onAdd = useCallback(() => { - setDrawer(CustomImage, { deviceModelId }, { forceDisableFocusTrap: true }); - }, [deviceModelId]); + setDrawer(CustomImage, { deviceModelId, hasCustomLockScreen }, { forceDisableFocusTrap: true }); + }, [deviceModelId, hasCustomLockScreen]); return ( @@ -50,7 +47,7 @@ const CustomImageManagerButton = (props: Props) => { disabled={disabled} data-testid="manager-custom-image-button" > - {lastSeenCustomImage.size ? t("changeCustomLockscreen.cta") : t("common.add")} + {hasCustomLockScreen ? t("changeCustomLockscreen.cta") : t("common.add")} ); diff --git a/apps/ledger-live-desktop/src/renderer/screens/manager/DeviceDashboard/DeviceInformationSummary/index.tsx b/apps/ledger-live-desktop/src/renderer/screens/manager/DeviceDashboard/DeviceInformationSummary/index.tsx index 7f0483fde0aa..01be4ee6da71 100644 --- a/apps/ledger-live-desktop/src/renderer/screens/manager/DeviceDashboard/DeviceInformationSummary/index.tsx +++ b/apps/ledger-live-desktop/src/renderer/screens/manager/DeviceDashboard/DeviceInformationSummary/index.tsx @@ -61,6 +61,7 @@ type Props = { isIncomplete: boolean; installQueue: string[]; uninstallQueue: string[]; + hasCustomLockScreen: boolean; }; /** @@ -79,6 +80,7 @@ const DeviceInformationSummary = ({ isIncomplete, installQueue, uninstallQueue, + hasCustomLockScreen, }: Props) => { const navigationLocked = useSelector(isNavigationLocked); @@ -164,6 +166,7 @@ const DeviceInformationSummary = ({ ) : null} diff --git a/apps/ledger-live-desktop/src/renderer/screens/manager/DeviceDashboard/index.tsx b/apps/ledger-live-desktop/src/renderer/screens/manager/DeviceDashboard/index.tsx index 029c3f89d6ab..3606f3914856 100644 --- a/apps/ledger-live-desktop/src/renderer/screens/manager/DeviceDashboard/index.tsx +++ b/apps/ledger-live-desktop/src/renderer/screens/manager/DeviceDashboard/index.tsx @@ -90,6 +90,7 @@ const DeviceDashboard = ({ const [appInstallDep, setAppInstallDep] = useState<{ app: App; dependencies: App[] } | undefined>( undefined, ); + const [appUninstallDep, setAppUninstallDep] = useState< { dependents: App[]; app: App } | undefined >(undefined); @@ -165,8 +166,8 @@ const DeviceDashboard = ({ // Not ideal but we have no concept of device ids so we can consider // an empty custom image size an indicator of not having an image set. // If this is troublesome we'd have to react by asking the device directly. - if (state.customImageBlocks === 0) reduxDispatch(clearLastSeenCustomImage()); - }, [reduxDispatch, state.customImageBlocks]); + if (result.customImageBlocks === 0) reduxDispatch(clearLastSeenCustomImage()); + }, [reduxDispatch, result.customImageBlocks]); const disableFirmwareUpdate = state.installQueue.length > 0 || state.uninstallQueue.length > 0; return ( @@ -209,6 +210,7 @@ const DeviceDashboard = ({ device={device} deviceName={deviceName} isIncomplete={isIncomplete} + hasCustomLockScreen={result.customImageBlocks !== 0} />