mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-20 02:59:26 +01:00
Merge branch 'braid/mxid-account-deactivate' into 'main'
chore: ask for MXID before deleting account See merge request famedly/fluffychat!993
This commit is contained in:
commit
1eba0e5dbe
@ -55,6 +55,14 @@
|
|||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"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": "Add a group description",
|
||||||
"@addGroupDescription": {
|
"@addGroupDescription": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
|
@ -87,14 +87,22 @@ class SettingsAccountController extends State<SettingsAccount> {
|
|||||||
OkCancelResult.cancel) {
|
OkCancelResult.cancel) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (await showOkCancelAlertDialog(
|
final supposedMxid = Matrix.of(context).client.userID!;
|
||||||
|
final mxids = await showTextInputDialog(
|
||||||
useRootNavigator: false,
|
useRootNavigator: false,
|
||||||
context: context,
|
context: context,
|
||||||
title: L10n.of(context)!.areYouSure,
|
title: L10n.of(context)!.confirmMatrixId,
|
||||||
okLabel: L10n.of(context)!.yes,
|
textFields: [
|
||||||
|
DialogTextField(
|
||||||
|
validator: (text) => text == supposedMxid
|
||||||
|
? null
|
||||||
|
: L10n.of(context)!.supposedMxid(supposedMxid),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
okLabel: L10n.of(context)!.delete,
|
||||||
cancelLabel: L10n.of(context)!.cancel,
|
cancelLabel: L10n.of(context)!.cancel,
|
||||||
) ==
|
);
|
||||||
OkCancelResult.cancel) {
|
if (mxids == null || mxids.length != 1 || mxids.single != supposedMxid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final input = await showTextInputDialog(
|
final input = await showTextInputDialog(
|
||||||
|
Loading…
Reference in New Issue
Block a user