Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Restore app lock through captured handle

Neeraj Guptabf67eef84d84
diff --git a/mobile/packages/lock_screen/lib/local_authentication_service.dart b/mobile/packages/lock_screen/lib/local_authentication_service.dart
index ea8717cc20..7ef2d5981f 100644
--- a/mobile/packages/lock_screen/lib/local_authentication_service.dart
+++ b/mobile/packages/lock_screen/lib/local_authentication_service.dart
@@ -40,7 +40,8 @@ class LocalAuthenticationService {
}
if (await isLocalAuthSupportedOnDevice() ||
LockScreenSettings.instance.getIsAppLockSet()) {
- AppLock.of(context)?.setEnabled(false);
+ final appLock = AppLock.of(context);
+ appLock?.setEnabled(false);
bool result = false;
WindowsLocalAuthenticationException? windowsLocalAuthException;
LocalAuthenticationUnavailableException? localAuthUnavailableException;
@@ -59,9 +60,9 @@ class LocalAuthenticationService {
localAuthUnavailableException = e;
logger.warning("System local authentication unavailable", e, s);
} finally {
- AppLock.of(
- context,
- )?.setEnabled(await LockScreenSettings.instance.shouldShowLockScreen());
+ appLock?.setEnabled(
+ await LockScreenSettings.instance.shouldShowLockScreen(),
+ );
if (refocusWindows) {
await PlatformUtil.refocusWindows();
}