From f76c2001986b9707d908acef0eaf36801d14d9a1 Mon Sep 17 00:00:00 2001 From: BelsethUwU Date: Fri, 9 Jun 2023 12:54:28 +0200 Subject: [PATCH] Fix : pop up invalide --- Sources/Stim/ProfilPage.xaml.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Sources/Stim/ProfilPage.xaml.cs b/Sources/Stim/ProfilPage.xaml.cs index 00cb67b..f66916c 100644 --- a/Sources/Stim/ProfilPage.xaml.cs +++ b/Sources/Stim/ProfilPage.xaml.cs @@ -18,12 +18,7 @@ public partial class ProfilPage : ContentPage ((App)App.Current).Manager.SaveUser(); } - private async void ChangeUsername(object sender, EventArgs e) - { - var newName = await this.ShowPopupAsync(new EntryPopup("Username")); - if (string.IsNullOrWhiteSpace(newName as string)) await this.ShowPopupAsync(new MessagePopup("Nom d'utilisateur invalide")); - else ((App)App.Current).Manager.CurrentUser.Username = (newName as string); - } + public async void PopUpUsername(object sender, EventArgs e) { var newName = await this.ShowPopupAsync(new EntryPopup("Username")); @@ -39,7 +34,7 @@ public partial class ProfilPage : ContentPage { Regex rg = new Regex("^(?=.*[A-Za-z])(?=.*[0-9@$!%*#?&])[A-Za-z-0-9@$!%*#?&]{8,}$"); var newPswd = await this.ShowPopupAsync(new EntryPopup("Password")); - if (string.IsNullOrWhiteSpace(newPswd as string) || rg.IsMatch(newPswd as string)) await this.ShowPopupAsync(new MessagePopup("Nom d'utilisateur invalide")); + if (string.IsNullOrWhiteSpace(newPswd as string) || rg.IsMatch(newPswd as string)) await this.ShowPopupAsync(new MessagePopup("Mot de passe invalide")); else ((App)App.Current).Manager.CurrentUser.Password = (newPswd as string); } public async void PopUpEmail(object sender, EventArgs e)