From b608a0779c85e9a99954f08695118a29fde2bc00 Mon Sep 17 00:00:00 2001 From: Marcel Baumgartner Date: Tue, 14 May 2024 21:57:08 +0200 Subject: [PATCH] Quick-fix for server loading in user view --- .gitignore | 3 ++- Moonlight/Features/Servers/UI/Layouts/UserLayout.razor | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6cfd4f4..1cd56bb 100644 --- a/.gitignore +++ b/.gitignore @@ -400,4 +400,5 @@ FodyWeavers.xsd storage/ .idea/.idea.Moonlight/.idea/dataSources.xml Moonlight/wwwroot/css/theme.css -Moonlight/wwwroot/css/theme.css.map \ No newline at end of file +Moonlight/wwwroot/css/theme.css.map +.idea/.idea.Moonlight/.idea/discord.xml diff --git a/Moonlight/Features/Servers/UI/Layouts/UserLayout.razor b/Moonlight/Features/Servers/UI/Layouts/UserLayout.razor index 43e08ff..64e6150 100644 --- a/Moonlight/Features/Servers/UI/Layouts/UserLayout.razor +++ b/Moonlight/Features/Servers/UI/Layouts/UserLayout.razor @@ -13,11 +13,13 @@ @using MoonCore.Exceptions @using Moonlight.Features.Servers.Configuration @using MoonCore.Services +@using Moonlight.Core.Services @inject Repository ServerRepository @inject ServerService ServerService @inject ToastService ToastService @inject AlertService AlertService +@inject IdentityService IdentityService @inject ConfigService ConfigService @implements IDisposable @@ -217,6 +219,12 @@ .Include(x => x.Owner) .First(x => x.Id == Id); + if (Server.Owner.Id != IdentityService.CurrentUser.Id && IdentityService.CurrentUser.Permissions < 5000) + { + Server = null!; + return; + } + await lazyLoader.SetText("Establishing a connection to the server"); // Create console wrapper