π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
fix(appLock):fixed-password-reset-issue
Aswin Asok917d34697e5b
diff --git a/desktop/src/main/services/device-lock.ts b/desktop/src/main/services/device-lock.tsindex e91b1d933b..599edd3f0e 100644--- a/desktop/src/main/services/device-lock.ts+++ b/desktop/src/main/services/device-lock.ts@@ -18,7 +18,10 @@ export const getNativeDeviceLockCapability = (): NativeDeviceLockCapability => {return {available: false,provider: "none",- reason: "touchid-not-enrolled",+ // `canPromptTouchID()` can become false for transient+ // runtime states (for example lockout/cancellation+ // sequences), not only for permanent hardware setup.+ reason: "touchid-temporarily-unavailable",};} catch (e) {log.warn(@@ -48,9 +51,7 @@ export const getNativeDeviceLockCapability = (): NativeDeviceLockCapability => {* cancelled, or failed.*/export const promptDeviceLock = async (reason: string) => {- const capability = getNativeDeviceLockCapability();-- if (!capability.available || capability.provider !== "touchid") {+ if (process.platform !== "darwin") {log.warn("Native device lock prompt is unavailable on this OS");return false;}diff --git a/desktop/src/types/ipc.ts b/desktop/src/types/ipc.tsindex 0c3f284327..51fc284062 100644--- a/desktop/src/types/ipc.ts+++ b/desktop/src/types/ipc.ts@@ -26,6 +26,7 @@ export type NativeDeviceLockProvider = "touchid" | "none";export type NativeDeviceLockUnavailableReason =| "unsupported-platform"| "touchid-not-enrolled"+ | "touchid-temporarily-unavailable"| "touchid-api-error";/**diff --git a/web/packages/base/types/ipc.ts b/web/packages/base/types/ipc.tsindex 66d4c17ecf..6b82a7ad7b 100644--- a/web/packages/base/types/ipc.ts+++ b/web/packages/base/types/ipc.ts@@ -17,6 +17,7 @@ export type NativeDeviceLockProvider = "touchid" | "none";export type NativeDeviceLockUnavailableReason =| "unsupported-platform"| "touchid-not-enrolled"+ | "touchid-temporarily-unavailable"| "touchid-api-error";/**diff --git a/web/packages/new/photos/components/AppLockOverlay.tsx b/web/packages/new/photos/components/AppLockOverlay.tsxindex c94a94f30d..bdb43c0eef 100644--- a/web/packages/new/photos/components/AppLockOverlay.tsx+++ b/web/packages/new/photos/components/AppLockOverlay.tsx@@ -617,6 +617,7 @@ const deviceLockErrorText = (result: DeviceLockUnlockResult) => {if (result.status === "not-supported") {switch (result.reason) {+ case "touchid-temporarily-unavailable":case "touchid-api-error":return t("device_lock_login_failed");case "unsupported-platform":@@ -1335,7 +1336,7 @@ const CooldownScreen: React.FC<CooldownScreenProps> = ({alignItems: "center",gap: 0,textAlign: "center",- mb: 3.5,+ mb: 2.5,}}><Typographydiff --git a/web/packages/new/photos/components/sidebar/AppLockSettings.tsx b/web/packages/new/photos/components/sidebar/AppLockSettings.tsxindex 3f948f38eb..5cca1b7fb3 100644--- a/web/packages/new/photos/components/sidebar/AppLockSettings.tsx+++ b/web/packages/new/photos/components/sidebar/AppLockSettings.tsx@@ -303,6 +303,7 @@ const deviceLockSetupErrorText = (result: SetupDeviceLockResult): string => {if (result.status === "not-supported") {switch (result.reason) {+ case "touchid-temporarily-unavailable":case "touchid-api-error":return t("device_lock_setup_failed");case "unsupported-platform":diff --git a/web/packages/new/photos/services/app-lock.ts b/web/packages/new/photos/services/app-lock.tsindex 791284a3d5..634e20e0b7 100644--- a/web/packages/new/photos/services/app-lock.ts+++ b/web/packages/new/photos/services/app-lock.ts@@ -505,6 +505,7 @@ const nativeCapabilityUnavailableReason = (): NativeDeviceLockUnavailableReason => {switch (capability.reason) {case "touchid-not-enrolled":+ case "touchid-temporarily-unavailable":case "touchid-api-error":return capability.reason;default:@@ -516,9 +517,16 @@ const resolveDeviceLockCapability = async (): Promise<DeviceLockCapability> => {const nativeCapability = await nativeDeviceLockCapability();if (nativeCapability.available) return { usable: true, mode: "native" };+ const reason = nativeCapabilityUnavailableReason(nativeCapability);+ if (reason === "touchid-temporarily-unavailable") {+ // Keep unlock/setup retryable on macOS even when capability checks are+ // briefly inconclusive.+ return { usable: true, mode: "native" };+ }+return {usable: false,- reason: nativeCapabilityUnavailableReason(nativeCapability),+ reason,};};