Stub Check Old Password + new String

This commit is contained in:
Sarah Jamie Lewis 2021-03-16 13:56:13 -07:00
parent 9eb54515d5
commit fdab657016
7 changed files with 17 additions and 2 deletions

View File

@ -48,6 +48,7 @@
"editProfile": "Profil bearbeiten",
"editProfileTitle": "Profil bearbeiten",
"enableGroups": "",
"enterCurrentPasswordForDelete": "",
"enterProfilePassword": "Geben Sie ein Passwort ein, um Ihre Profile anzuzeigen",
"error0ProfilesLoadedForPassword": "0 Profile mit diesem Passwort geladen",
"experimentsEnabled": "Experimente aktiviert",

View File

@ -48,6 +48,7 @@
"editProfile": "Edit Profille",
"editProfileTitle": "Edit Profile",
"enableGroups": "Enable Group Chat",
"enterCurrentPasswordForDelete": "Please enter current password to delete this profile.",
"enterProfilePassword": "Enter a password to view your profiles",
"error0ProfilesLoadedForPassword": "0 profiles loaded with that password",
"experimentsEnabled": "Enable Experiments",

View File

@ -48,6 +48,7 @@
"editProfile": "Editar perfil",
"editProfileTitle": "Editar perfil",
"enableGroups": "",
"enterCurrentPasswordForDelete": "",
"enterProfilePassword": "Ingresa tu contraseña para ver tus perfiles",
"error0ProfilesLoadedForPassword": "0 perfiles cargados con esa contraseña",
"experimentsEnabled": "Experimentos habilitados",

View File

@ -48,6 +48,7 @@
"editProfile": "",
"editProfileTitle": "",
"enableGroups": "",
"enterCurrentPasswordForDelete": "",
"enterProfilePassword": "",
"error0ProfilesLoadedForPassword": "",
"experimentsEnabled": "",

View File

@ -48,6 +48,7 @@
"editProfile": "Modifica profilo",
"editProfileTitle": "Modifica profilo",
"enableGroups": "",
"enterCurrentPasswordForDelete": "",
"enterProfilePassword": "Inserisci una password per visualizzare i tuoi profili",
"error0ProfilesLoadedForPassword": "0 profili caricati con quella password",
"experimentsEnabled": "Esperimenti abilitati",

View File

@ -48,6 +48,7 @@
"editProfile": "",
"editProfileTitle": "",
"enableGroups": "",
"enterCurrentPasswordForDelete": "",
"enterProfilePassword": "",
"error0ProfilesLoadedForPassword": "",
"experimentsEnabled": "",

View File

@ -359,8 +359,9 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
SizedBox(
height: 20,
),
Tooltip(message: AppLocalizations.of(context).enterCurrentPasswordForDelete, child:
ElevatedButton.icon(
onPressed: () {
onPressed: checkCurrentPassword() ? null : () {
showAlertDialog(context);
},
style: ElevatedButton.styleFrom(
@ -368,10 +369,11 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
.current()
.defaultButtonColor()),
icon: Icon(Icons.delete_forever),
label: Text(
AppLocalizations.of(context)
.deleteBtn),
)
))
]))
]))))));
});
@ -452,6 +454,12 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
}
}
}
// TODO Stub - wire this into a libCwtch call.
bool checkCurrentPassword() {
return ctrlrOldPass.value.text.isEmpty;
}
}
showAlertDialog(BuildContext context) {
@ -503,3 +511,4 @@ showAlertDialog(BuildContext context) {
},
);
}