[auth] Auth minor improvements & bug fixes (#3475)
## Description ## Tests
This commit is contained in:
@@ -8,7 +8,6 @@ import 'package:ente_auth/ente_theme_data.dart';
|
||||
import 'package:ente_auth/events/trigger_logout_event.dart';
|
||||
import "package:ente_auth/l10n/l10n.dart";
|
||||
import 'package:ente_auth/locale.dart';
|
||||
import 'package:ente_auth/services/preference_service.dart';
|
||||
import 'package:ente_auth/theme/text_style.dart';
|
||||
import 'package:ente_auth/ui/account/email_entry_page.dart';
|
||||
import 'package:ente_auth/ui/account/login_page.dart';
|
||||
@@ -50,7 +49,6 @@ class _OnboardingPageState extends State<OnboardingPage> {
|
||||
await autoLogoutAlert(context);
|
||||
});
|
||||
super.initState();
|
||||
PreferenceService.instance.configureDefaults().ignore();
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -57,12 +57,6 @@ class PreferenceService {
|
||||
await _prefs.setBool(kCompactMode, value);
|
||||
}
|
||||
|
||||
Future<void> configureDefaults() async {
|
||||
if (!_prefs.containsKey(kCompactMode)) {
|
||||
await _prefs.setBool(kCompactMode, true);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> setHideCodes(bool value) async {
|
||||
await _prefs.setBool(kShouldHideCodesKey, value);
|
||||
Bus.instance.fire(IconsChangedEvent());
|
||||
|
||||
@@ -102,16 +102,7 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
|
||||
trailingIcon: Icons.chevron_right_outlined,
|
||||
trailingIconIsMuted: true,
|
||||
onTap: () async {
|
||||
final bool hasAuthenticated = await LocalAuthenticationService
|
||||
.instance
|
||||
.requestLocalAuthentication(
|
||||
context,
|
||||
context.l10n.authToViewPasskey,
|
||||
);
|
||||
await PlatformUtil.refocusWindows();
|
||||
if (hasAuthenticated) {
|
||||
await onPasskeyClick(context);
|
||||
}
|
||||
await onPasskeyClick(context);
|
||||
},
|
||||
),
|
||||
sectionOptionSpacing,
|
||||
|
||||
@@ -142,7 +142,10 @@ class SettingsPage extends StatelessWidget {
|
||||
sectionSpacing,
|
||||
]);
|
||||
|
||||
if (Platform.isAndroid || kDebugMode) {
|
||||
if (Platform.isAndroid ||
|
||||
Platform.isWindows ||
|
||||
Platform.isLinux ||
|
||||
kDebugMode) {
|
||||
contents.addAll([
|
||||
const ThemeSwitchWidget(),
|
||||
sectionSpacing,
|
||||
|
||||
Reference in New Issue
Block a user