fix : Evite les crash et permet de build ? (Pourquoi Sonar buildait avant ?)
continuous-integration/drone/push Build is passing Details

Popup_qui_marche_pas
BelsethUwU 2 years ago
parent d9ee9add3d
commit cd90803e9c

@ -15,7 +15,7 @@ namespace Model
public string? Username public string? Username
{ {
get => username; get => username;
private set set
{ {
if (string.IsNullOrWhiteSpace(value)) username = "Default"; if (string.IsNullOrWhiteSpace(value)) username = "Default";
else else

@ -10,8 +10,7 @@ public partial class App : Application
public App() public App()
{ {
InitializeComponent(); InitializeComponent();
//Faut changer le boot sur LoginPage plus tard, j'ai mit create là pour pouvoir use l'appli, ce référer au comment sur create et loginpage. MainPage = new LoginPage();
MainPage = new Create();
if (File.Exists(Path.Combine(FileSystem.Current.AppDataDirectory, "games.xml"))) Manager = new Manager(new Persistance(FileSystem.Current.AppDataDirectory)); if (File.Exists(Path.Combine(FileSystem.Current.AppDataDirectory, "games.xml"))) Manager = new Manager(new Persistance(FileSystem.Current.AppDataDirectory));
else Manager = new(new Stub()); else Manager = new(new Stub());
} }

@ -24,7 +24,7 @@ public partial class Create : ContentPage
Application.Current.MainPage = new AppShell(); Application.Current.MainPage = new AppShell();
await Shell.Current.GoToAsync("//MainPage"); await Shell.Current.GoToAsync("//MainPage");
} }
else Error.Children.Add(new Label { Text = "Mot de passe incorrect", TextColor = Colors.Red, VerticalTextAlignment = TextAlignment.Start }); else Error.Children.Add(new Label { Text = "Mot de passe invalide, votre mot de passe doit contenir une Majuscule, une minuscule, un chiffre et faire au moins 8 caractères", TextColor = Colors.Red, VerticalTextAlignment = TextAlignment.Start });
} }
else Error.Children.Add(new Label { Text = "Ce nom d'utilisateur est déjà pris", TextColor = Colors.Red, VerticalTextAlignment = TextAlignment.Start }); else Error.Children.Add(new Label { Text = "Ce nom d'utilisateur est déjà pris", TextColor = Colors.Red, VerticalTextAlignment = TextAlignment.Start });
} }

@ -12,9 +12,12 @@ public partial class DetailledPage : ContentPage
InitializeComponent(); InitializeComponent();
BindingContext = game; BindingContext = game;
CurrGame= game; CurrGame= game;
if (CurrGame != null)
{
avgLabel.Text = game.GetAvgRate().ToString(); avgLabel.Text = game.GetAvgRate().ToString();
AddStars(starsContainer, game.GetAvgRate()); AddStars(starsContainer, game.GetAvgRate());
} }
}
private void AddStars(object sender, EventArgs e) private void AddStars(object sender, EventArgs e)
{ {

@ -27,7 +27,6 @@ public partial class MainPage : ContentPage
private void SearchBar_GameChanged(object sender, TextChangedEventArgs e) private void SearchBar_GameChanged(object sender, TextChangedEventArgs e)
{ {
SearchBar searchBar = (SearchBar)sender;
string GameText = Game.Text; string GameText = Game.Text;
string Tag1Text = Tag1.Text; string Tag1Text = Tag1.Text;
string Tag2Text = Tag2.Text; string Tag2Text = Tag2.Text;
@ -47,7 +46,5 @@ public partial class MainPage : ContentPage
{ {
((App)App.Current).Manager.ResearchedGame.Add(game); ((App)App.Current).Manager.ResearchedGame.Add(game);
} }
} }
} }

@ -20,6 +20,6 @@ public partial class ProfilPage : ContentPage
{ {
var newName = await this.ShowPopupAsync(new EntryPopup("Username")); var newName = await this.ShowPopupAsync(new EntryPopup("Username"));
if (string.IsNullOrWhiteSpace(newName as string)) await this.ShowPopupAsync(new MessagePopup("Nom d'utilisateur invalide")); if (string.IsNullOrWhiteSpace(newName as string)) await this.ShowPopupAsync(new MessagePopup("Nom d'utilisateur invalide"));
else ((App)App.Current).Manager.CurrentUser.ChangeUsername(newName as string); else ((App)App.Current).Manager.CurrentUser.Username = (newName as string);
} }
} }
Loading…
Cancel
Save