fix : pas de delete de review qui sont pas à nous
continuous-integration/drone/push Build is passing Details

master
BelsethUwU 2 years ago
parent f76c200198
commit c8b55a9bc4

@ -32,13 +32,17 @@ public partial class DetailledPage : ContentPage
private async void RemoveReview(object sender, EventArgs e)
{
var res = await this.ShowPopupAsync(new ConfirmationPopup("Voulez-vous vraiment supprimer votre commentaire ?"));
if (res != null && res is bool v && v)
if (((sender as ImageButton).BindingContext as Review).AuthorName == ((App)App.Current).Manager.CurrentUser.Username)
{
(App.Current as App).Manager.SelectedGame.RemoveReview((sender as ImageButton).BindingContext as Review);
(App.Current as App).Manager.SaveGames();
await this.ShowPopupAsync(new MessagePopup("Commentaire supprimé !"));
var res = await this.ShowPopupAsync(new ConfirmationPopup("Voulez-vous vraiment supprimer votre commentaire ?"));
if (res != null && res is bool v && v)
{
(App.Current as App).Manager.SelectedGame.RemoveReview((sender as ImageButton).BindingContext as Review);
(App.Current as App).Manager.SaveGames();
await this.ShowPopupAsync(new MessagePopup("Commentaire supprimé !"));
}
}
else await this.ShowPopupAsync(new MessagePopup("Ce commentaire ne vous appartiens pas"));
}
private async void AddFollow(object sender, EventArgs e)

Loading…
Cancel
Save