11using System . ComponentModel . DataAnnotations ;
22using Microsoft . AspNetCore . Components . Forms ;
3- using Microsoft . AspNetCore . Components . Server . ProtectedBrowserStorage ;
43using MudBlazor ;
54
65namespace Web . Components . Pages . Case ;
@@ -11,10 +10,10 @@ public class CaseBase : ComponentBase
1110 [ Inject ] private LighthouseNotesAPIGet LighthouseNotesAPIGet { get ; set ; } = default ! ;
1211 [ Inject ] private LighthouseNotesAPIPut LighthouseNotesAPIPut { get ; set ; } = default ! ;
1312 [ Inject ] private LighthouseNotesAPIDelete LighthouseNotesAPIDelete { get ; set ; } = default ! ;
14- [ Inject ] private ProtectedLocalStorage ProtectedLocalStore { get ; set ; } = null ! ;
1513 [ Inject ] private ISnackbar Snackbar { get ; set ; } = default ! ;
1614 [ Inject ] private IJSRuntime JS { get ; set ; } = default ! ;
1715 [ Inject ] private ISettingsService SettingsService { get ; set ; } = default ! ;
16+ [ Inject ] private NavigationManager NavigationManager { get ; set ; } = default ! ;
1817
1918 // Page variables
2019 protected API . Case SCase = null ! ;
@@ -54,6 +53,15 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
5453 if ( Settings . Auth0UserId == null || Settings . OrganizationId == null || Settings . UserId == null ||
5554 Settings . S3Endpoint == null )
5655 {
56+ // Get the settings redirect url
57+ string ? settingsRedirect = await SettingsService . CheckOrSet ( ) ;
58+
59+ // If the settings redirect url is not null then redirect
60+ if ( settingsRedirect != null )
61+ {
62+ NavigationManager . NavigateTo ( settingsRedirect , true ) ;
63+ }
64+
5765 // Use the setting service to retrieve the settings
5866 Settings = await SettingsService . Get ( ) ;
5967
0 commit comments