Added multiple qol imporvements
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user