mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 13:05:11 +00:00
chore: Add error report for incorrect recovery key
This commit is contained in:
parent
9c55800aeb
commit
d8cc1bdf25
3 changed files with 19 additions and 5 deletions
|
@ -2562,5 +2562,6 @@
|
|||
"searchChatsRooms": "Search for #chats, @users...",
|
||||
"groupName": "Group name",
|
||||
"createGroupAndInviteUsers": "Create a group and invite users",
|
||||
"groupCanBeFoundViaSearch": "Group can be found via search"
|
||||
"groupCanBeFoundViaSearch": "Group can be found via search",
|
||||
"wrongRecoveryKey": "Sorry... this does not seem to be the correct recovery key."
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'package:fluffychat/utils/error_reporter.dart';
|
||||
import 'package:fluffychat/utils/localized_exception_extension.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:adaptive_dialog/adaptive_dialog.dart';
|
||||
|
@ -5,7 +7,6 @@ import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'package:future_loading_dialog/future_loading_dialog.dart';
|
||||
import 'package:matrix/encryption.dart';
|
||||
import 'package:matrix/encryption/utils/bootstrap.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/config/themes.dart';
|
||||
|
@ -311,11 +312,19 @@ class BootstrapDialogState extends State<BootstrapDialog> {
|
|||
);
|
||||
}
|
||||
}
|
||||
} catch (e, s) {
|
||||
Logs().w('Unable to unlock SSSS', e, s);
|
||||
} on InvalidPassphraseException catch (e) {
|
||||
setState(
|
||||
() => _recoveryKeyInputError =
|
||||
L10n.of(context)!.oopsSomethingWentWrong,
|
||||
e.toLocalizedString(context),
|
||||
);
|
||||
} catch (e, s) {
|
||||
ErrorReporter(
|
||||
context,
|
||||
'Unable to open SSSS with recovery key',
|
||||
).onErrorCallback(e, s);
|
||||
setState(
|
||||
() => _recoveryKeyInputError =
|
||||
e.toLocalizedString(context),
|
||||
);
|
||||
} finally {
|
||||
setState(
|
||||
|
|
|
@ -3,6 +3,7 @@ import 'dart:io';
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:matrix/encryption.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/pages/tasks/tasks.dart';
|
||||
|
@ -20,6 +21,9 @@ extension LocalizedExceptionExtension on Object {
|
|||
return (this as MatrixException).errorMessage;
|
||||
}
|
||||
}
|
||||
if (this is InvalidPassphraseException) {
|
||||
return L10n.of(context)!.wrongRecoveryKey;
|
||||
}
|
||||
if (this is TodoListChangedException) {
|
||||
return L10n.of(context)!.todoListChangedError;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue