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-bottom) + 20px)
calc(var(--safe-area-inset-left) + 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 ( 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 You can restart the app to see if this guy is gone. If you meet this guy
repeatly, please report to us. repeatly, please report to us.
</p> </p>
<div> <div class="actions">
<Button onClick={() => (window.location.replace("/"))}> <Button
onClick={() => window.location.replace("/")}
variant="contained"
>
Restart App Restart App
</Button> </Button>
</div> </div>
@ -61,7 +87,10 @@ const UnexpectedError: Component<{ error?: any }> = (props) => {
<summary> <summary>
{errorMsg.loading ? "Generating " : " "}Technical Infomation {errorMsg.loading ? "Generating " : " "}Technical Infomation
</summary> </summary>
<pre>{errorMsg()}</pre> <pre>
On: {window.location.href} <br />
{errorMsg()}
</pre>
</details> </details>
</main> </main>
); );