Skip to content

Commit

Permalink
krille-chan#12 UC-5007: Pers. Einstellungen bearbeiten // option 'cha…
Browse files Browse the repository at this point in the history
…ngepassword' and...
  • Loading branch information
Monz Philipp authored and Hannich Matthias committed Aug 13, 2023
1 parent 937dc42 commit 5c6644e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 50 deletions.
36 changes: 0 additions & 36 deletions lib/pages/settings_security/settings_security.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,42 +25,6 @@ class SettingsSecurity extends StatefulWidget {
}

class SettingsSecurityController extends State<SettingsSecurity> {
void changePasswordAccountAction() async {
final input = await showTextInputDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.changePassword,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
textFields: [
DialogTextField(
hintText: L10n.of(context)!.chooseAStrongPassword,
obscureText: true,
minLines: 1,
maxLines: 1,
),
DialogTextField(
hintText: L10n.of(context)!.repeatPassword,
obscureText: true,
minLines: 1,
maxLines: 1,
),
],
);
if (input == null) return;
final success = await showFutureLoadingDialog(
context: context,
future: () => Matrix.of(context)
.client
.changePassword(input.last, oldPassword: input.first),
);
if (success.error == null) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(L10n.of(context)!.passwordHasBeenChanged)),
);
}
}

void setAppLockAction() async {
final currentLock =
await const FlutterSecureStorage().read(key: SettingKeys.appLockKey);
Expand Down
14 changes: 0 additions & 14 deletions lib/pages/settings_security/settings_security_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,6 @@ class SettingsSecurityView extends StatelessWidget {
title: Text(L10n.of(context)!.ignoredUsers),
onTap: () => VRouter.of(context).to('ignorelist'),
),
ListTile(
leading: const Icon(Icons.password_outlined),
trailing: const Icon(Icons.chevron_right_outlined),
title: Text(
L10n.of(context)!.changePassword,
),
onTap: controller.changePasswordAccountAction,
),
ListTile(
leading: const Icon(Icons.mail_outlined),
trailing: const Icon(Icons.chevron_right_outlined),
title: Text(L10n.of(context)!.passwordRecovery),
onTap: () => VRouter.of(context).to('3pid'),
),
if (Matrix.of(context).client.encryption != null) ...{
const Divider(thickness: 1),
if (PlatformInfos.isMobile)
Expand Down

0 comments on commit 5c6644e

Please sign in to comment.