diff --git a/Components/Pages/Ephemeral.razor b/Components/Pages/Ephemeral.razor
index a36404a..e75d990 100644
--- a/Components/Pages/Ephemeral.razor
+++ b/Components/Pages/Ephemeral.razor
@@ -1,6 +1,10 @@
@page "/ephemeral"
+@implements IDisposable
@inject IJSRuntime JS
@inject State State
+
+
+
Eph.emer.al is a place for fleeting thoughts. Everything on this page will disappear after a while.
@@ -24,7 +28,21 @@
protected override async Task OnInitializedAsync() {
await base.OnInitializedAsync();
if (messages == null || messages.Count == 0) messages = await State.GetEphemeralMessages();
+ State.PropertyChanged += StateChanged;
+ State.CanRefresh = true;
await InvokeAsync(StateHasChanged);
await JS.InvokeVoidAsync("removeElementById", "ephemeral-loading");
}
+
+ private async void StateChanged(object? sender, PropertyChangedEventArgs e) {
+ if (e.PropertyName == nameof(State.IsRefreshing) && State.IsRefreshing) {
+ messages = await State.GetEphemeralMessages(true);
+ State.IsRefreshing = false;
+ }
+ }
+
+ public void Dispose() {
+ State.PropertyChanged -= StateChanged;
+ State.CanRefresh = false;
+ }
}
\ No newline at end of file
diff --git a/Components/Pages/Now.razor b/Components/Pages/Now.razor
index 750778f..f8f9feb 100644
--- a/Components/Pages/Now.razor
+++ b/Components/Pages/Now.razor
@@ -1,6 +1,10 @@
@page "/now"
+@implements IDisposable
@inject IJSRuntime JS
@inject State State
+
+
+
Feel free to stroll through the now.garden and take a look at what people are up to.
@@ -31,7 +35,21 @@
protected override async Task OnInitializedAsync() {
await base.OnInitializedAsync();
if (garden == null || garden.Count == 0) garden = await State.GetNowGarden();
+ State.PropertyChanged += StateChanged;
+ State.CanRefresh = true;
await InvokeAsync(StateHasChanged);
await JS.InvokeVoidAsync("removeElementById", "now-loading");
}
+
+ private async void StateChanged(object? sender, PropertyChangedEventArgs e) {
+ if (e.PropertyName == nameof(State.IsRefreshing) && State.IsRefreshing) {
+ garden = await State.GetNowGarden(true);
+ State.IsRefreshing = false;
+ }
+ }
+
+ public void Dispose() {
+ State.PropertyChanged -= StateChanged;
+ State.CanRefresh = false;
+ }
}
diff --git a/Components/Pages/Person.razor b/Components/Pages/Person.razor
index 9c46b7f..8553890 100644
--- a/Components/Pages/Person.razor
+++ b/Components/Pages/Person.razor
@@ -3,6 +3,8 @@
@inject IJSRuntime JS
@inject NavigationManager Nav
+
+
@Address
@@ -51,7 +53,7 @@
}
-
+
@if(Address == State.SelectedAddressName) {