Show option to contact support when verification fails (#1491)

This commit is contained in:
Vishnu Mohandas 2023-11-12 12:19:00 +05:30 committed by GitHub
commit 58df09ba78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 17 deletions

View file

@ -679,33 +679,23 @@ class UserService {
} on DioError catch (e, s) {
await dialog.hide();
if (e.response != null && e.response!.statusCode == 401) {
final dialogChoice = await showChoiceDialog(
await _showContactSupportDialog(
context,
title: S.of(context).incorrectPasswordTitle,
body: S.of(context).pleaseTryAgain,
firstButtonLabel: S.of(context).contactSupport,
secondButtonLabel: S.of(context).ok,
S.of(context).incorrectPasswordTitle,
S.of(context).pleaseTryAgain,
);
if (dialogChoice!.action == ButtonAction.first) {
await sendLogs(
context,
S.of(context).contactSupport,
"support@ente.io",
postShare: () {},
);
}
} else {
_logger.fine('failed to verify password', e, s);
await showErrorDialog(
_logger.severe('failed to verify password', e, s);
await _showContactSupportDialog(
context,
S.of(context).oops,
S.of(context).verificationFailedPleaseTryAgain,
);
}
} catch (e, s) {
_logger.fine('failed to verify password', e, s);
_logger.severe('failed to verify password', e, s);
await dialog.hide();
await showErrorDialog(
await _showContactSupportDialog(
context,
S.of(context).oops,
S.of(context).verificationFailedPleaseTryAgain,
@ -1174,4 +1164,26 @@ class UserService {
rethrow;
}
}
Future<void> _showContactSupportDialog(
BuildContext context,
String title,
String message,
) async {
final dialogChoice = await showChoiceDialog(
context,
title: title,
body: message,
firstButtonLabel: S.of(context).contactSupport,
secondButtonLabel: S.of(context).ok,
);
if (dialogChoice!.action == ButtonAction.first) {
await sendLogs(
context,
S.of(context).contactSupport,
"support@ente.io",
postShare: () {},
);
}
}
}

1
plugins/clip_ggml Submodule

@ -0,0 +1 @@
Subproject commit e65aa597f859081f0bc5ee3e48cf60da9548457b