protected override async Task OnInitializedAsync() { ProfileResponse Profile = await JSRuntime.InvokeAsync <ProfileResponse>("GetProfile"); if (Profile.Success) { CurrentUser.SetCurrentUser(Profile.User); CanRender = true; StateHasChanged(); await JSRuntime.InvokeVoidAsync("LoadCards"); } else { switch (Profile.StatusCode) { case 503: NavigationManager.NavigateTo("/maintenance"); break; default: NavigationManager.NavigateTo("/"); break; } } MaintenanceCheckResponse Response = await JSRuntime.InvokeAsync <MaintenanceCheckResponse>("MaintenanceCheck"); MaintenanceMode = Response.IsUndergoingMaintenance; if (MaintenanceMode) { await JSRuntime.InvokeVoidAsync("SetTitle", "🚧 Maintenance Mode"); } }
protected override async Task OnInitializedAsync() { MaintenanceCheckResponse Response = await JSRuntime.InvokeAsync <MaintenanceCheckResponse>("MaintenanceCheck"); if (!Response.IsUndergoingMaintenance) { NavigationManager.NavigateTo("/"); } }
protected override async Task Main() { MaintenanceCheckResponse Response = await JSRuntime.InvokeAsync <MaintenanceCheckResponse>("MaintenanceCheck"); IsUndergoingMaintenance = Response.IsUndergoingMaintenance; }