mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-26 06:49:22 +00:00
Do delete user account
This commit is contained in:
parent
e204c62ba9
commit
4c1e33a264
@ -147,4 +147,13 @@ class AccountHelper {
|
|||||||
await APIRequest(uri: "account/disconnect_all_devices", needLogin: true)
|
await APIRequest(uri: "account/disconnect_all_devices", needLogin: true)
|
||||||
.execWithThrow();
|
.execWithThrow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Remove permanently a user account
|
||||||
|
///
|
||||||
|
/// Throws in case of failure
|
||||||
|
static Future<void> deleteAccount(String password) async {
|
||||||
|
await APIRequest(uri: "account/delete", needLogin: true)
|
||||||
|
.addString("password", password)
|
||||||
|
.execWithThrow();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:comunic/helpers/account_helper.dart';
|
||||||
import 'package:comunic/ui/dialogs/input_user_password_dialog.dart';
|
import 'package:comunic/ui/dialogs/input_user_password_dialog.dart';
|
||||||
import 'package:comunic/utils/intl_utils.dart';
|
import 'package:comunic/utils/intl_utils.dart';
|
||||||
import 'package:comunic/utils/ui_utils.dart';
|
import 'package:comunic/utils/ui_utils.dart';
|
||||||
@ -60,9 +61,10 @@ class __AccountPrivacyScreenState extends State<_AccountPrivacyScreen> {
|
|||||||
true) return;
|
true) return;
|
||||||
|
|
||||||
// Delete account
|
// Delete account
|
||||||
print("Delete account");
|
await AccountHelper.deleteAccount(password);
|
||||||
} catch (e, stack) {
|
} catch (e, stack) {
|
||||||
print("Could not delete user account! $e\n$stack");
|
print("Could not delete user account! $e\n$stack");
|
||||||
|
showSimpleSnack(context, tr("Could not delete your account!"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user