From 2e56cdc91a888f0551b9813b771d8d0c7659cca3 Mon Sep 17 00:00:00 2001 From: Robert Brands Date: Sat, 14 Dec 2024 18:49:55 +0100 Subject: [PATCH] Users/rbrands/2024 12 14 (#151) * Compability with older iOS * Error message and disabling features that could cause issues with older iOS versions --- MeetUpPlanner/Client/App.razor | 23 +++++++------ MeetUpPlanner/Client/ExceptionBoundary.razor | 33 +++++++++++++++++++ .../Client/MeetUpPlanner.Client.csproj | 6 +++- MeetUpPlanner/Client/wwwroot/css/app.css | 8 +++++ MeetUpPlanner/Client/wwwroot/index.html | 2 ++ 5 files changed, 61 insertions(+), 11 deletions(-) create mode 100644 MeetUpPlanner/Client/ExceptionBoundary.razor diff --git a/MeetUpPlanner/Client/App.razor b/MeetUpPlanner/Client/App.razor index 422f33e..16fae2e 100644 --- a/MeetUpPlanner/Client/App.razor +++ b/MeetUpPlanner/Client/App.razor @@ -1,10 +1,13 @@ - - - - - - -

Ups, aber der Link ist falsch.

-
-
-
+ + + + + + + + +

Sorry, there's nothing at this address.

+
+
+
+
diff --git a/MeetUpPlanner/Client/ExceptionBoundary.razor b/MeetUpPlanner/Client/ExceptionBoundary.razor new file mode 100644 index 0000000..8cee4a1 --- /dev/null +++ b/MeetUpPlanner/Client/ExceptionBoundary.razor @@ -0,0 +1,33 @@ +@typeparam TError + +
+ @if (Error != null) + { +
+

Ein Fehler ist aufgetreten

+

@Error.Message

+
+ } + else + { + @ChildContent + } +
+ +@code { + [Parameter] public RenderFragment ChildContent { get; set; } + private Exception Error { get; set; } + + protected override void OnParametersSet() + { + try + { + Error = null; + base.OnParametersSet(); + } + catch (Exception ex) + { + Error = ex; + } + } +} \ No newline at end of file diff --git a/MeetUpPlanner/Client/MeetUpPlanner.Client.csproj b/MeetUpPlanner/Client/MeetUpPlanner.Client.csproj index 7eaab62..b47ee3a 100644 --- a/MeetUpPlanner/Client/MeetUpPlanner.Client.csproj +++ b/MeetUpPlanner/Client/MeetUpPlanner.Client.csproj @@ -1,7 +1,11 @@  net8.0 - service-worker-assets.js + browser-wasm + false + true + false + service-worker-assets.js diff --git a/MeetUpPlanner/Client/wwwroot/css/app.css b/MeetUpPlanner/Client/wwwroot/css/app.css index 6fdeada..e710c97 100644 --- a/MeetUpPlanner/Client/wwwroot/css/app.css +++ b/MeetUpPlanner/Client/wwwroot/css/app.css @@ -41,6 +41,14 @@ a, .btn-link { width: 100%; z-index: 1000; } +.error-boundary .alert { + margin: 20px; + padding: 20px; + border: 1px solid red; + background-color: #f8d7da; + color: #721c24; +} + #blazor-error-ui .dismiss { cursor: pointer; diff --git a/MeetUpPlanner/Client/wwwroot/index.html b/MeetUpPlanner/Client/wwwroot/index.html index a6e76d3..90e8a9a 100644 --- a/MeetUpPlanner/Client/wwwroot/index.html +++ b/MeetUpPlanner/Client/wwwroot/index.html @@ -40,6 +40,8 @@ + +