mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 07:28:26 +00:00
[mob][auth] Fix 'App lock' not working onTap from security section on macOS and Linux
This commit is contained in:
parent
a14a8b0cfb
commit
c3c2dd5cc6
@ -23,7 +23,7 @@ class LocalAuthenticationService {
|
||||
BuildContext context,
|
||||
String infoMessage,
|
||||
) async {
|
||||
if (await _isLocalAuthSupportedOnDevice()) {
|
||||
if (await isLocalAuthSupportedOnDevice()) {
|
||||
AppLock.of(context)!.setEnabled(false);
|
||||
final result = await requestAuthentication(
|
||||
context,
|
||||
@ -94,7 +94,7 @@ class LocalAuthenticationService {
|
||||
String errorDialogContent, [
|
||||
String errorDialogTitle = "",
|
||||
]) async {
|
||||
if (await _isLocalAuthSupportedOnDevice()) {
|
||||
if (await isLocalAuthSupportedOnDevice()) {
|
||||
AppLock.of(context)!.disable();
|
||||
final result = await requestAuthentication(
|
||||
context,
|
||||
@ -120,7 +120,7 @@ class LocalAuthenticationService {
|
||||
return false;
|
||||
}
|
||||
|
||||
Future<bool> _isLocalAuthSupportedOnDevice() async {
|
||||
Future<bool> isLocalAuthSupportedOnDevice() async {
|
||||
try {
|
||||
return Platform.isMacOS || Platform.isLinux
|
||||
? await FlutterLocalAuthentication().canAuthenticate()
|
||||
|
@ -23,7 +23,6 @@ import 'package:ente_auth/utils/platform_util.dart';
|
||||
import 'package:ente_auth/utils/toast_util.dart';
|
||||
import 'package:ente_crypto_dart/ente_crypto_dart.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:local_auth/local_auth.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
|
||||
class SecuritySectionWidget extends StatefulWidget {
|
||||
@ -144,7 +143,8 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
|
||||
trailingIcon: Icons.chevron_right_outlined,
|
||||
trailingIconIsMuted: true,
|
||||
onTap: () async {
|
||||
if (await LocalAuthentication().isDeviceSupported()) {
|
||||
if (await LocalAuthenticationService.instance
|
||||
.isLocalAuthSupportedOnDevice()) {
|
||||
final bool result = await requestAuthentication(
|
||||
context,
|
||||
context.l10n.authToChangeLockscreenSetting,
|
||||
|
Loading…
x
Reference in New Issue
Block a user