diff --git a/src/Recollections.Blazor.UI/Entries/Components/EntryPicker.razor.cs b/src/Recollections.Blazor.UI/Entries/Components/EntryPicker.razor.cs
index 4557eff..eca47c5 100644
--- a/src/Recollections.Blazor.UI/Entries/Components/EntryPicker.razor.cs
+++ b/src/Recollections.Blazor.UI/Entries/Components/EntryPicker.razor.cs
@@ -21,9 +21,6 @@ public partial class EntryPicker
[Parameter]
public Action Selected { get; set; }
- [CascadingParameter]
- protected UserState UserState { get; set; }
-
protected Modal Modal { get; set; }
private int offset;
diff --git a/src/Recollections.Blazor.UI/Entries/Pages/BeingDetail.razor b/src/Recollections.Blazor.UI/Entries/Pages/BeingDetail.razor
index 60bd6c0..e28f19a 100644
--- a/src/Recollections.Blazor.UI/Entries/Pages/BeingDetail.razor
+++ b/src/Recollections.Blazor.UI/Entries/Pages/BeingDetail.razor
@@ -1,4 +1,5 @@
@page "/beings/{BeingId}"
+@inherits UserStateComponentBase
@if (Model != null)
{
diff --git a/src/Recollections.Blazor.UI/Entries/Pages/BeingDetail.razor.cs b/src/Recollections.Blazor.UI/Entries/Pages/BeingDetail.razor.cs
index 5841dad..9b8b927 100644
--- a/src/Recollections.Blazor.UI/Entries/Pages/BeingDetail.razor.cs
+++ b/src/Recollections.Blazor.UI/Entries/Pages/BeingDetail.razor.cs
@@ -21,9 +21,6 @@ public partial class BeingDetail
[Inject]
protected Navigator Navigator { get; set; }
- [CascadingParameter]
- protected UserState UserState { get; set; }
-
private string previousBeingId;
[Parameter]
@@ -36,12 +33,6 @@ public partial class BeingDetail
protected BeingIconPicker IconPicker { get; set; }
- protected async override Task OnInitializedAsync()
- {
- await base.OnInitializedAsync();
- await UserState.EnsureInitializedAsync();
- }
-
public override Task SetParametersAsync(ParameterView parameters)
{
previousBeingId = BeingId;
diff --git a/src/Recollections.Blazor.UI/Entries/Pages/Beings.razor b/src/Recollections.Blazor.UI/Entries/Pages/Beings.razor
index 421e8ff..ae4e04c 100644
--- a/src/Recollections.Blazor.UI/Entries/Pages/Beings.razor
+++ b/src/Recollections.Blazor.UI/Entries/Pages/Beings.razor
@@ -1,4 +1,5 @@
@page "/beings"
+@inherits UserStateComponentBase
diff --git a/src/Recollections.Blazor.UI/Entries/Pages/Beings.razor.cs b/src/Recollections.Blazor.UI/Entries/Pages/Beings.razor.cs
index 8deb9dc..a9806b5 100644
--- a/src/Recollections.Blazor.UI/Entries/Pages/Beings.razor.cs
+++ b/src/Recollections.Blazor.UI/Entries/Pages/Beings.razor.cs
@@ -21,9 +21,6 @@ public partial class Beings
[Inject]
protected Api Api { get; set; }
- [CascadingParameter]
- protected UserState UserState { get; set; }
-
protected bool IsLoading { get; set; }
public string Name { get; set; }
@@ -36,8 +33,6 @@ protected async override Task OnInitializedAsync()
IsLoading = true;
await base.OnInitializedAsync();
- await UserState.EnsureAuthenticatedAsync();
-
await LoadDataAsync();
}
diff --git a/src/Recollections.Blazor.UI/Entries/Pages/Calendar.razor b/src/Recollections.Blazor.UI/Entries/Pages/Calendar.razor
index 94d6a42..a0d82cf 100644
--- a/src/Recollections.Blazor.UI/Entries/Pages/Calendar.razor
+++ b/src/Recollections.Blazor.UI/Entries/Pages/Calendar.razor
@@ -1,6 +1,7 @@
@page "/calendar"
@page "/calendar/{Year:int}"
@page "/calendar/{Year:int}/{Month:int}"
+@inherits UserStateComponentBase
diff --git a/src/Recollections.Blazor.UI/Entries/Pages/Calendar.razor.cs b/src/Recollections.Blazor.UI/Entries/Pages/Calendar.razor.cs
index 866d414..c999904 100644
--- a/src/Recollections.Blazor.UI/Entries/Pages/Calendar.razor.cs
+++ b/src/Recollections.Blazor.UI/Entries/Pages/Calendar.razor.cs
@@ -23,9 +23,6 @@ public partial class Calendar
[Inject]
protected Navigator Navigator { get; set; }
- [CascadingParameter]
- protected UserState UserState { get; set; }
-
[Parameter]
public int? Year { get; set; }
@@ -44,12 +41,6 @@ public partial class Calendar
protected List Models { get; } = new List();
- protected override async Task OnInitializedAsync()
- {
- await base.OnInitializedAsync();
- await UserState.EnsureAuthenticatedAsync();
- }
-
public override async Task SetParametersAsync(ParameterView parameters)
{
int? prevYear = Year;
diff --git a/src/Recollections.Blazor.UI/Entries/Pages/EntryDetail.razor b/src/Recollections.Blazor.UI/Entries/Pages/EntryDetail.razor
index 3202dd6..8038405 100644
--- a/src/Recollections.Blazor.UI/Entries/Pages/EntryDetail.razor
+++ b/src/Recollections.Blazor.UI/Entries/Pages/EntryDetail.razor
@@ -1,4 +1,5 @@
@page "/entries/{EntryId}"
+@inherits UserStateComponentBase
diff --git a/src/Recollections.Blazor.UI/Entries/Pages/EntryDetail.razor.cs b/src/Recollections.Blazor.UI/Entries/Pages/EntryDetail.razor.cs
index 05ef57a..30d584d 100644
--- a/src/Recollections.Blazor.UI/Entries/Pages/EntryDetail.razor.cs
+++ b/src/Recollections.Blazor.UI/Entries/Pages/EntryDetail.razor.cs
@@ -43,9 +43,6 @@ public partial class EntryDetail
[Inject]
protected IExceptionHandler ExceptionHandler { get; set; }
- [CascadingParameter]
- protected UserState UserState { get; set; }
-
private string previousEntryId;
[Parameter]
@@ -90,7 +87,6 @@ protected async override Task OnInitializedAsync()
Log.Debug("OnInitializedAsync");
await base.OnInitializedAsync();
- await UserState.EnsureInitializedAsync();
if (UserState.IsAuthenticated)
PoiToggleButton = new PoiToggleButton(Navigator, Properties, UserState);
diff --git a/src/Recollections.Blazor.UI/Entries/Pages/ImageDetail.razor b/src/Recollections.Blazor.UI/Entries/Pages/ImageDetail.razor
index 6fd4c1f..e810ba2 100644
--- a/src/Recollections.Blazor.UI/Entries/Pages/ImageDetail.razor
+++ b/src/Recollections.Blazor.UI/Entries/Pages/ImageDetail.razor
@@ -1,4 +1,5 @@
@page "/entries/{EntryId}/images/{ImageId}"
+@inherits UserStateComponentBase
@if (Model != null)
{
diff --git a/src/Recollections.Blazor.UI/Entries/Pages/ImageDetail.razor.cs b/src/Recollections.Blazor.UI/Entries/Pages/ImageDetail.razor.cs
index 70840cb..789acf9 100644
--- a/src/Recollections.Blazor.UI/Entries/Pages/ImageDetail.razor.cs
+++ b/src/Recollections.Blazor.UI/Entries/Pages/ImageDetail.razor.cs
@@ -37,9 +37,6 @@ public partial class ImageDetail
[Parameter]
public string ImageId { get; set; }
- [CascadingParameter]
- protected UserState UserState { get; set; }
-
private ImageModel original;
protected ImageModel Model { get; set; }
protected OwnerModel Owner { get; set; }
@@ -47,12 +44,6 @@ public partial class ImageDetail
protected PermissionContainerState Permissions { get; } = new PermissionContainerState();
- protected async override Task OnInitializedAsync()
- {
- await base.OnInitializedAsync();
- await UserState.EnsureInitializedAsync();
- }
-
public override Task SetParametersAsync(ParameterView parameters)
{
previousImageId = ImageId;
diff --git a/src/Recollections.Blazor.UI/Entries/Pages/Map.razor b/src/Recollections.Blazor.UI/Entries/Pages/Map.razor
index ed23ce6..b0ed0a1 100644
--- a/src/Recollections.Blazor.UI/Entries/Pages/Map.razor
+++ b/src/Recollections.Blazor.UI/Entries/Pages/Map.razor
@@ -1,5 +1,6 @@
-@layout Commons.Layouts.HeadLayout
-@page "/map"
+@page "/map"
+@layout Commons.Layouts.HeadLayout
+@inherits UserStateComponentBase
diff --git a/src/Recollections.Blazor.UI/Entries/Pages/Map.razor.cs b/src/Recollections.Blazor.UI/Entries/Pages/Map.razor.cs
index 02a9b4e..96304bd 100644
--- a/src/Recollections.Blazor.UI/Entries/Pages/Map.razor.cs
+++ b/src/Recollections.Blazor.UI/Entries/Pages/Map.razor.cs
@@ -23,9 +23,6 @@ public partial class Map
[Inject]
protected PropertyCollection Properties { get; set; }
- [CascadingParameter]
- protected UserState UserState { get; set; }
-
protected List Entries { get; set; } = new List();
protected List Markers { get; } = new List();
@@ -37,7 +34,6 @@ protected async override Task OnInitializedAsync()
PoiToggleButton = new PoiToggleButton(Navigator, Properties, UserState);
await base.OnInitializedAsync();
- await UserState.EnsureAuthenticatedAsync();
await LoadAsync();
}
diff --git a/src/Recollections.Blazor.UI/Entries/Pages/Search.razor b/src/Recollections.Blazor.UI/Entries/Pages/Search.razor
index a78db19..bc4a8a9 100644
--- a/src/Recollections.Blazor.UI/Entries/Pages/Search.razor
+++ b/src/Recollections.Blazor.UI/Entries/Pages/Search.razor
@@ -1,4 +1,5 @@
@page "/search"
+@inherits UserStateComponentBase
diff --git a/src/Recollections.Blazor.UI/Entries/Pages/Search.razor.cs b/src/Recollections.Blazor.UI/Entries/Pages/Search.razor.cs
index f93dc31..59448e9 100644
--- a/src/Recollections.Blazor.UI/Entries/Pages/Search.razor.cs
+++ b/src/Recollections.Blazor.UI/Entries/Pages/Search.razor.cs
@@ -21,9 +21,6 @@ public partial class Search : IDisposable
[Inject]
protected ILog Log { get; set; }
- [CascadingParameter]
- protected UserState UserState { get; set; }
-
[Inject]
protected Api Api { get; set; }
@@ -49,7 +46,6 @@ public partial class Search : IDisposable
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
- await UserState.EnsureAuthenticatedAsync();
Navigator.LocationChanged += OnLocationChanged;
}
diff --git a/src/Recollections.Blazor.UI/Entries/Pages/Stories.razor b/src/Recollections.Blazor.UI/Entries/Pages/Stories.razor
index d25c402..10a60a1 100644
--- a/src/Recollections.Blazor.UI/Entries/Pages/Stories.razor
+++ b/src/Recollections.Blazor.UI/Entries/Pages/Stories.razor
@@ -1,4 +1,5 @@
@page "/stories"
+@inherits UserStateComponentBase
diff --git a/src/Recollections.Blazor.UI/Entries/Pages/Stories.razor.cs b/src/Recollections.Blazor.UI/Entries/Pages/Stories.razor.cs
index 21ef54b..a75135e 100644
--- a/src/Recollections.Blazor.UI/Entries/Pages/Stories.razor.cs
+++ b/src/Recollections.Blazor.UI/Entries/Pages/Stories.razor.cs
@@ -21,9 +21,6 @@ public partial class Stories
[Inject]
protected Api Api { get; set; }
- [CascadingParameter]
- protected UserState UserState { get; set; }
-
protected bool IsLoading { get; set; }
public string Title { get; set; }
@@ -36,8 +33,6 @@ protected async override Task OnInitializedAsync()
IsLoading = true;
await base.OnInitializedAsync();
- await UserState.EnsureAuthenticatedAsync();
-
await LoadDataAsync();
}
diff --git a/src/Recollections.Blazor.UI/Entries/Pages/StoryDetail.razor b/src/Recollections.Blazor.UI/Entries/Pages/StoryDetail.razor
index 0be8ae5..6c29970 100644
--- a/src/Recollections.Blazor.UI/Entries/Pages/StoryDetail.razor
+++ b/src/Recollections.Blazor.UI/Entries/Pages/StoryDetail.razor
@@ -1,4 +1,5 @@
@page "/stories/{StoryId}"
+@inherits UserStateComponentBase
@if (Model != null)
{
diff --git a/src/Recollections.Blazor.UI/Entries/Pages/StoryDetail.razor.cs b/src/Recollections.Blazor.UI/Entries/Pages/StoryDetail.razor.cs
index 617ec31..15c0e5b 100644
--- a/src/Recollections.Blazor.UI/Entries/Pages/StoryDetail.razor.cs
+++ b/src/Recollections.Blazor.UI/Entries/Pages/StoryDetail.razor.cs
@@ -30,9 +30,6 @@ public partial class StoryDetail
[Inject]
protected IExceptionHandler ExceptionHandler { get; set; }
- [CascadingParameter]
- protected UserState UserState { get; set; }
-
private string previousStoryId;
[Parameter]
@@ -43,12 +40,6 @@ public partial class StoryDetail
protected OwnerModel Owner { get; set; }
protected PermissionContainerState Permissions { get; } = new PermissionContainerState();
- protected async override Task OnInitializedAsync()
- {
- await base.OnInitializedAsync();
- await UserState.EnsureInitializedAsync();
- }
-
public override Task SetParametersAsync(ParameterView parameters)
{
previousStoryId = StoryId;
diff --git a/src/Recollections.Blazor.UI/Entries/Pages/Timeline.razor b/src/Recollections.Blazor.UI/Entries/Pages/Timeline.razor
index 0083301..e138f64 100644
--- a/src/Recollections.Blazor.UI/Entries/Pages/Timeline.razor
+++ b/src/Recollections.Blazor.UI/Entries/Pages/Timeline.razor
@@ -1,4 +1,5 @@
@page "/"
+@inherits UserStateComponentBase
diff --git a/src/Recollections.Blazor.UI/Entries/Pages/Timeline.razor.cs b/src/Recollections.Blazor.UI/Entries/Pages/Timeline.razor.cs
index ef38c7e..56335da 100644
--- a/src/Recollections.Blazor.UI/Entries/Pages/Timeline.razor.cs
+++ b/src/Recollections.Blazor.UI/Entries/Pages/Timeline.razor.cs
@@ -28,9 +28,6 @@ public partial class Timeline
[Inject]
protected ILog Log { get; set; }
- [CascadingParameter]
- protected UserState UserState { get; set; }
-
[Parameter]
public bool AllowCreate { get; set; } = true;
@@ -51,7 +48,6 @@ protected async override Task OnInitializedAsync()
Log.Debug("Timeline.Init");
await base.OnInitializedAsync();
- await UserState.EnsureAuthenticatedAsync();
Log.Debug("Timeline.Load");
await LoadAsync();