Added multiple qol imporvements

This commit is contained in:
2026-01-23 20:32:55 +01:00
parent dd1cfc15e5
commit cf24691b5e
8 changed files with 130 additions and 13 deletions

View File

@@ -6,7 +6,7 @@ using SpotiParty.Web.Services;
namespace SpotiParty.Web.Components.Pages;
public partial class EnqueuePage(AuthorizationHandler authHandler, NavigationManager navigator, DatabaseContext context) : ComponentBase {
public partial class EnqueuePage(AuthorizationHandler authHandler, NavigationManager navigator, DatabaseContext context, DashboardAuthHandler authContext) : ComponentBase {
[Parameter]
public string EventId { get; set; } = string.Empty;
@@ -42,8 +42,10 @@ public partial class EnqueuePage(AuthorizationHandler authHandler, NavigationMan
StateHasChanged();
var currentUser = await authContext.GetCurrentUser();
var now = DateTime.Now;
if (_event.Start > now || _event.End < now) {
if ((_event.Start > now || _event.End < now) && currentUser?.UserId != _event.Host.UserId) {
navigator.NavigateTo("/", forceLoad: true);
return;
}