1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2024-12-14 11:47:33 +00:00

Add a reload button to error boundary

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.
This commit is contained in:
nimbleghost 2023-06-17 22:15:02 +02:00
parent fafe478e5c
commit 9ba733d4e0
2 changed files with 7 additions and 2 deletions

View file

@ -389,6 +389,7 @@
"error_boundary_title": "Oh no, ntfy crashed",
"error_boundary_description": "This should obviously not happen. Very sorry about this.<br/>If you have a minute, please <githubLink>report this on GitHub</githubLink>, or let us know via <discordLink>Discord</discordLink> or <matrixLink>Matrix</matrixLink>.",
"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",

View file

@ -101,11 +101,15 @@ class ErrorBoundaryImpl extends React.Component {
}}
/>
</p>
<p>
<div style={{ display: "flex", gap: 5 }}>
<Button variant="outlined" onClick={() => this.copyStack()}>
{t("error_boundary_button_copy_stack_trace")}
</Button>
</p>
<Button variant="outlined" onClick={() => window.location.reload()}>
{t("error_boundary_button_reload_ntfy")}
</Button>
</div>
<h3>{t("error_boundary_stack_trace")}</h3>
{this.state.niceStack ? (
<pre>{this.state.niceStack}</pre>