From 9ba733d4e0835ed1cec872593cddc04ace719bd7 Mon Sep 17 00:00:00 2001 From: nimbleghost <132819643+nimbleghost@users.noreply.github.com> Date: Sat, 17 Jun 2023 22:15:02 +0200 Subject: [PATCH] Add a reload button to error boundary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are sometimes edge cases on iOS which cause the app to crash, it’s good to have a reload button as there’s no browser chrome (reload, back, forward) in an iOS standalone PWA. --- web/public/static/langs/en.json | 1 + web/src/components/ErrorBoundary.jsx | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/web/public/static/langs/en.json b/web/public/static/langs/en.json index a2ec2dea..38e8e527 100644 --- a/web/public/static/langs/en.json +++ b/web/public/static/langs/en.json @@ -389,6 +389,7 @@ "error_boundary_title": "Oh no, ntfy crashed", "error_boundary_description": "This should obviously not happen. Very sorry about this.
If you have a minute, please report this on GitHub, or let us know via Discord or Matrix.", "error_boundary_button_copy_stack_trace": "Copy stack trace", + "error_boundary_button_reload_ntfy": "Reload ntfy", "error_boundary_stack_trace": "Stack trace", "error_boundary_gathering_info": "Gather more info …", "error_boundary_unsupported_indexeddb_title": "Private browsing not supported", diff --git a/web/src/components/ErrorBoundary.jsx b/web/src/components/ErrorBoundary.jsx index 9715c0cb..adb177c6 100644 --- a/web/src/components/ErrorBoundary.jsx +++ b/web/src/components/ErrorBoundary.jsx @@ -101,11 +101,15 @@ class ErrorBoundaryImpl extends React.Component { }} />

-

+

-

+ + +

{t("error_boundary_stack_trace")}

{this.state.niceStack ? (
{this.state.niceStack}