|
@@ -30,6 +30,7 @@ import 'package:photos/ui/account/password_reentry_page.dart';
|
|
import 'package:photos/ui/account/two_factor_authentication_page.dart';
|
|
import 'package:photos/ui/account/two_factor_authentication_page.dart';
|
|
import 'package:photos/ui/account/two_factor_recovery_page.dart';
|
|
import 'package:photos/ui/account/two_factor_recovery_page.dart';
|
|
import 'package:photos/ui/account/two_factor_setup_page.dart';
|
|
import 'package:photos/ui/account/two_factor_setup_page.dart';
|
|
|
|
+import 'package:photos/ui/components/dialog_widget.dart';
|
|
import 'package:photos/utils/crypto_util.dart';
|
|
import 'package:photos/utils/crypto_util.dart';
|
|
import 'package:photos/utils/dialog_util.dart';
|
|
import 'package:photos/utils/dialog_util.dart';
|
|
import 'package:photos/utils/navigation_util.dart';
|
|
import 'package:photos/utils/navigation_util.dart';
|
|
@@ -96,7 +97,7 @@ class UserService {
|
|
);
|
|
);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- unawaited(showGenericErrorDialog(context));
|
|
|
|
|
|
+ unawaited(showGenericErrorDialog(context: context));
|
|
} on DioError catch (e) {
|
|
} on DioError catch (e) {
|
|
await dialog.hide();
|
|
await dialog.hide();
|
|
_logger.info(e);
|
|
_logger.info(e);
|
|
@@ -109,12 +110,12 @@ class UserService {
|
|
),
|
|
),
|
|
);
|
|
);
|
|
} else {
|
|
} else {
|
|
- unawaited(showGenericErrorDialog(context));
|
|
|
|
|
|
+ unawaited(showGenericErrorDialog(context: context));
|
|
}
|
|
}
|
|
} catch (e) {
|
|
} catch (e) {
|
|
await dialog.hide();
|
|
await dialog.hide();
|
|
_logger.severe(e);
|
|
_logger.severe(e);
|
|
- unawaited(showGenericErrorDialog(context));
|
|
|
|
|
|
+ unawaited(showGenericErrorDialog(context: context));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -196,7 +197,7 @@ class UserService {
|
|
} catch (e) {
|
|
} catch (e) {
|
|
_logger.severe(e);
|
|
_logger.severe(e);
|
|
await dialog.hide();
|
|
await dialog.hide();
|
|
- showGenericErrorDialog(context);
|
|
|
|
|
|
+ showGenericErrorDialog(context: context);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -220,7 +221,7 @@ class UserService {
|
|
} catch (e) {
|
|
} catch (e) {
|
|
_logger.severe(e);
|
|
_logger.severe(e);
|
|
await dialog.hide();
|
|
await dialog.hide();
|
|
- await showGenericErrorDialog(context);
|
|
|
|
|
|
+ await showGenericErrorDialog(context: context);
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -229,8 +230,6 @@ class UserService {
|
|
BuildContext context,
|
|
BuildContext context,
|
|
String challengeResponse,
|
|
String challengeResponse,
|
|
) async {
|
|
) async {
|
|
- final dialog = createProgressDialog(context, "Deleting account...");
|
|
|
|
- await dialog.show();
|
|
|
|
try {
|
|
try {
|
|
final response = await _enteDio.delete(
|
|
final response = await _enteDio.delete(
|
|
"/users/delete",
|
|
"/users/delete",
|
|
@@ -241,20 +240,12 @@ class UserService {
|
|
if (response != null && response.statusCode == 200) {
|
|
if (response != null && response.statusCode == 200) {
|
|
// clear data
|
|
// clear data
|
|
await Configuration.instance.logout();
|
|
await Configuration.instance.logout();
|
|
- await dialog.hide();
|
|
|
|
- showToast(
|
|
|
|
- context,
|
|
|
|
- "We have deleted your account and scheduled your uploaded data "
|
|
|
|
- "for deletion.",
|
|
|
|
- );
|
|
|
|
- Navigator.of(context).popUntil((route) => route.isFirst);
|
|
|
|
} else {
|
|
} else {
|
|
throw Exception("delete action failed");
|
|
throw Exception("delete action failed");
|
|
}
|
|
}
|
|
} catch (e) {
|
|
} catch (e) {
|
|
_logger.severe(e);
|
|
_logger.severe(e);
|
|
- await dialog.hide();
|
|
|
|
- showGenericErrorDialog(context);
|
|
|
|
|
|
+ rethrow;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -657,7 +648,7 @@ class UserService {
|
|
try {
|
|
try {
|
|
recoveryKey = await getOrCreateRecoveryKey(context);
|
|
recoveryKey = await getOrCreateRecoveryKey(context);
|
|
} catch (e) {
|
|
} catch (e) {
|
|
- showGenericErrorDialog(context);
|
|
|
|
|
|
+ showGenericErrorDialog(context: context);
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
final dialog = createProgressDialog(context, "Verifying...");
|
|
final dialog = createProgressDialog(context, "Verifying...");
|