From 633c97e0dac032770fa3dadcc7b8665a59df3a3c Mon Sep 17 00:00:00 2001 From: Michele Date: Fri, 24 Sep 2021 21:53:00 +0100 Subject: [PATCH] small fixes --- .../Handlers/GetCampaignsCommandHandler.cs | 10 ++++++---- Sledgemapper/UI/MainWidget.Custom.cs | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Sledgemapper.Api/Handlers/GetCampaignsCommandHandler.cs b/Sledgemapper.Api/Handlers/GetCampaignsCommandHandler.cs index 12b226f..666f17f 100644 --- a/Sledgemapper.Api/Handlers/GetCampaignsCommandHandler.cs +++ b/Sledgemapper.Api/Handlers/GetCampaignsCommandHandler.cs @@ -28,11 +28,13 @@ namespace Sledgemapper.Api.Handlers { var user = await _dbcontext.Users.FindAsync(command.UserId); _dbcontext.Attach(user); - var campaigns = _dbcontext.Campaigns.Include(c => c.InvitedUsers).Include(c => c.Maps).Include(c => c.Owner).Where(campaign => campaign.OwnerId == command.UserId || campaign.InvitedUsers.Contains(user)); + var campaigns = await _dbcontext.Campaigns + .Include(c => c.InvitedUsers) + .Include(c => c.Owner) + .Where(campaign => campaign.OwnerId == command.UserId || campaign.InvitedUsers.Contains(user)).ToListAsync(); - return campaigns. - Select(c => new Campaign { Id = c.CampaignId, Name = c.CampaignName, Maps = c.Maps.Select(m => new Map { SessionName = m.SessionName }).ToList() }) - .ToList(); + return campaigns.Select(c => new Campaign { Id = c.CampaignId, Name = c.CampaignName }).ToList(); + } catch (Exception ex) { diff --git a/Sledgemapper/UI/MainWidget.Custom.cs b/Sledgemapper/UI/MainWidget.Custom.cs index c565054..c2b6686 100644 --- a/Sledgemapper/UI/MainWidget.Custom.cs +++ b/Sledgemapper/UI/MainWidget.Custom.cs @@ -114,7 +114,6 @@ namespace Sledgemapper.UI private void OnBtnToolbarDeleteClicked(object sender, EventArgs e) { - Messenger.Publish(new ErrorMessage(this, "test")); State.Instance.InsertMode = InsertMode.NewDelete; ClearSelection(); @@ -231,6 +230,8 @@ namespace Sledgemapper.UI MenuCampaingNew.Enabled = true; MenuMapNew.Enabled = false; MenuMapOpen.Enabled = false; + MenuConnectSync.Enabled = false; + MenuConnectUpload.Enabled = false; MenuCampaignPlayers.Enabled = false; lblCampaign.Text = "n/a"; lblMap.Text = "n/a";