mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-19 10:39:26 +01:00
chore: ask for MXID before deleting account
Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
This commit is contained in:
parent
e1769d8654
commit
af51c9c0ea
@ -55,6 +55,14 @@
|
||||
"type": "text",
|
||||
"placeholders": {}
|
||||
},
|
||||
"confirmMatrixId": "Please confirm your Matrix ID in order to delete your account.",
|
||||
"supposedMxid": "This should be {mxid}",
|
||||
"@supposedMxid": {
|
||||
"type": "text",
|
||||
"placeholders": {
|
||||
"mxid": {}
|
||||
}
|
||||
},
|
||||
"addGroupDescription": "Add a group description",
|
||||
"@addGroupDescription": {
|
||||
"type": "text",
|
||||
|
@ -87,14 +87,22 @@ class SettingsAccountController extends State<SettingsAccount> {
|
||||
OkCancelResult.cancel) {
|
||||
return;
|
||||
}
|
||||
if (await showOkCancelAlertDialog(
|
||||
useRootNavigator: false,
|
||||
context: context,
|
||||
title: L10n.of(context)!.areYouSure,
|
||||
okLabel: L10n.of(context)!.yes,
|
||||
cancelLabel: L10n.of(context)!.cancel,
|
||||
) ==
|
||||
OkCancelResult.cancel) {
|
||||
final supposedMxid = Matrix.of(context).client.userID!;
|
||||
final mxids = await showTextInputDialog(
|
||||
useRootNavigator: false,
|
||||
context: context,
|
||||
title: L10n.of(context)!.confirmMatrixId,
|
||||
textFields: [
|
||||
DialogTextField(
|
||||
validator: (text) => text == supposedMxid
|
||||
? null
|
||||
: L10n.of(context)!.supposedMxid(supposedMxid),
|
||||
),
|
||||
],
|
||||
okLabel: L10n.of(context)!.delete,
|
||||
cancelLabel: L10n.of(context)!.cancel,
|
||||
);
|
||||
if (mxids == null || mxids.length != 1 || mxids.single != supposedMxid) {
|
||||
return;
|
||||
}
|
||||
final input = await showTextInputDialog(
|
||||
|
Loading…
Reference in New Issue
Block a user