Skip to content

Commit

Permalink
Merge pull request #60 from ente-io/fix_change_email
Browse files Browse the repository at this point in the history
Fix change email
  • Loading branch information
ua741 authored Feb 13, 2023
2 parents 6582c3b + dd558cb commit c5d68b4
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
13 changes: 9 additions & 4 deletions lib/app/view/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import 'package:ente_auth/ui/home_page.dart';
import 'package:ente_auth/ui/settings/app_update_dialog.dart';
import 'package:flutter/foundation.dart';
import "package:flutter/material.dart";
import "package:flutter_localizations/flutter_localizations.dart";
import 'package:flutter_localizations/flutter_localizations.dart';

class App extends StatefulWidget {
const App({Key key});
Expand Down Expand Up @@ -79,9 +79,14 @@ class _AppState extends State<App> {
theme: lightTheme,
darkTheme: dartTheme,
debugShowCheckedModeBanner: false,
supportedLocales: supportedLocales,
supportedLocales: appSupportedLocales,
localeListResolutionCallback: localResolutionCallBack,
localizationsDelegates: AppLocalizations.localizationsDelegates,
localizationsDelegates: const [
AppLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
routes: _getRoutes,
),
);
Expand All @@ -92,7 +97,7 @@ class _AppState extends State<App> {
theme: lightThemeData,
darkTheme: darkThemeData,
debugShowCheckedModeBanner: false,
supportedLocales: supportedLocales,
supportedLocales: appSupportedLocales,
localeListResolutionCallback: localResolutionCallBack,
localizationsDelegates: const [
AppLocalizations.delegate,
Expand Down
4 changes: 2 additions & 2 deletions lib/locale.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import 'dart:ui';
// list of locales which are enabled for auth app.
// Add more language to the list only when at least 90% of the strings are
// translated in the corresponding language.
const List<Locale> supportedLocales = <Locale>[
const List<Locale> appSupportedLocales = <Locale>[
Locale('en'),
];

Locale localResolutionCallBack(locales, supportedLocales) {
for (Locale locale in locales) {
if (supportedLocales.contains(locale)) {
if (appSupportedLocales.contains(locale)) {
return locale;
}
}
Expand Down
6 changes: 2 additions & 4 deletions lib/ui/account/change_email_dialog.dart
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
// @dart=2.9

import 'package:ente_auth/l10n/l10n.dart';
import 'package:ente_auth/services/user_service.dart';
import 'package:ente_auth/utils/dialog_util.dart';
import 'package:ente_auth/utils/email_util.dart';
import 'package:flutter/material.dart';

class ChangeEmailDialog extends StatefulWidget {
const ChangeEmailDialog({Key key}) : super(key: key);
const ChangeEmailDialog({Key? key}) : super(key: key);

@override
State<ChangeEmailDialog> createState() => _ChangeEmailDialogState();
}

class _ChangeEmailDialogState extends State<ChangeEmailDialog> {
String _email;
String _email = "";

@override
Widget build(BuildContext context) {
Expand Down
10 changes: 9 additions & 1 deletion lib/ui/tools/app_lock.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import 'dart:async';

import 'package:ente_auth/l10n/l10n.dart';
import 'package:ente_auth/locale.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

/// A widget which handles app lifecycle events for showing and hiding a lock screen.
/// This should wrap around a `MyApp` widget (or equivalent).
Expand Down Expand Up @@ -108,8 +110,14 @@ class _AppLockState extends State<AppLock> with WidgetsBindingObserver {
themeMode: ThemeMode.system,
theme: widget.lightTheme,
darkTheme: widget.darkTheme,
supportedLocales: supportedLocales,
supportedLocales: appSupportedLocales,
localeListResolutionCallback: localResolutionCallBack,
localizationsDelegates: const [
AppLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
onGenerateRoute: (settings) {
switch (settings.name) {
case '/lock-screen':
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ente_auth
description: ente two-factor authenticator
version: 1.0.30+30
version: 1.0.31+31
publish_to: none

environment:
Expand Down

0 comments on commit c5d68b4

Please sign in to comment.