UnexpectedError: adjust visual, add selectable

This commit is contained in:
thislight 2024-11-21 15:58:27 +08:00
parent 147c9fbce1
commit df5a976ec3
No known key found for this signature in database
GPG key ID: FCFE5192241CCD4E

View file

@ -42,6 +42,29 @@ const UnexpectedError: Component<{ error?: any }> = (props) => {
calc(var(--safe-area-inset-bottom) + 20px)
calc(var(--safe-area-inset-left) + 20px);
}
details {
max-width: 100vw;
max-width: 100dvw;
overflow: auto;
& * {
user-select: all;
}
summary {
position: sticky;
left: 0;
top: 0;
user-select: none;
}
}
.actions {
margin-top: 20px;
margin-bottom: 20px;
}
`;
return (
@ -52,8 +75,11 @@ const UnexpectedError: Component<{ error?: any }> = (props) => {
You can restart the app to see if this guy is gone. If you meet this guy
repeatly, please report to us.
</p>
<div>
<Button onClick={() => (window.location.replace("/"))}>
<div class="actions">
<Button
onClick={() => window.location.replace("/")}
variant="contained"
>
Restart App
</Button>
</div>
@ -61,7 +87,10 @@ const UnexpectedError: Component<{ error?: any }> = (props) => {
<summary>
{errorMsg.loading ? "Generating " : " "}Technical Infomation
</summary>
<pre>{errorMsg()}</pre>
<pre>
On: {window.location.href} <br />
{errorMsg()}
</pre>
</details>
</main>
);