about summary refs log tree commit diff
path: root/MatrixUtils.Web/Shared
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-05-03 19:40:00 +0200
committerRory& <root@rory.gay>2024-05-03 19:40:00 +0200
commit222f475dfd662980d5e0b9f27efa951f91604364 (patch)
tree71777992828134ee89249a7e37339bc4aa89ba86 /MatrixUtils.Web/Shared
parentCleanup, work on index2, some tooling updates (diff)
downloadMatrixUtils-222f475dfd662980d5e0b9f27efa951f91604364.tar.xz
All kinds of changes
Diffstat (limited to 'MatrixUtils.Web/Shared')
-rw-r--r--MatrixUtils.Web/Shared/UpdateAvailableDetector.razor38
-rw-r--r--MatrixUtils.Web/Shared/UpdateAvailableDetector.razor.css15
2 files changed, 0 insertions, 53 deletions
diff --git a/MatrixUtils.Web/Shared/UpdateAvailableDetector.razor b/MatrixUtils.Web/Shared/UpdateAvailableDetector.razor
deleted file mode 100644

index 5197a6f..0000000 --- a/MatrixUtils.Web/Shared/UpdateAvailableDetector.razor +++ /dev/null
@@ -1,38 +0,0 @@ -@* Source: https://whuysentruit.medium.com/blazor-wasm-pwa-adding-a-new-update-available-notification-d9f65c4ad13 *@ -@inject IJSRuntime _jsRuntime - -@if (_newVersionAvailable) -{ - <button type="button" class="btn btn-warning shadow floating-update-button" onclick="window.location.reload()"> - A new version of the application is available. Click here to reload. - </button> -} - -@code { - - private bool _newVersionAvailable = false; - - protected override async Task OnInitializedAsync() - { - await RegisterForUpdateAvailableNotification(); - } - - private async Task RegisterForUpdateAvailableNotification() - { - await _jsRuntime.InvokeAsync<object>( - identifier: "registerForUpdateAvailableNotification", - DotNetObjectReference.Create(this), - nameof(OnUpdateAvailable)); - } - - [JSInvokable(nameof(OnUpdateAvailable))] - public Task OnUpdateAvailable() - { - _newVersionAvailable = true; - - StateHasChanged(); - - return Task.CompletedTask; - } - -} \ No newline at end of file diff --git a/MatrixUtils.Web/Shared/UpdateAvailableDetector.razor.css b/MatrixUtils.Web/Shared/UpdateAvailableDetector.razor.css deleted file mode 100644
index 32bff09..0000000 --- a/MatrixUtils.Web/Shared/UpdateAvailableDetector.razor.css +++ /dev/null
@@ -1,15 +0,0 @@ -.floating-update-button { - position: fixed; - - right: 2rem; - bottom: 2rem; - - padding: 1rem 1.5rem; - - animation: fadein 2s ease-out; -} - -@keyframes fadein { - from { right: -100%; } - to { right: 2rem; } -} \ No newline at end of file