Skip to content

Commit 4cde4f9

Browse files
committed
chore: add restart button for generic error component
1 parent 80594ea commit 4cde4f9

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

messages/renderer/en.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
"description": "Text for button to reload page.",
2424
"message": "Reload"
2525
},
26+
"components.generic-route-error-component.restart": {
27+
"description": "Text for button to restart app.",
28+
"message": "Restart"
29+
},
2630
"components.generic-route-error-component.somethinWentWrong": {
2731
"description": "Title text of page error",
2832
"message": "Something went wrong"

src/renderer/src/components/generic-route-error-component.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export function GenericRouteErrorComponent({ error }: ErrorComponentProps) {
8484
display="flex"
8585
flexDirection="column"
8686
alignItems="center"
87+
gap={4}
8788
>
8889
<Button
8990
fullWidth
@@ -97,6 +98,20 @@ export function GenericRouteErrorComponent({ error }: ErrorComponentProps) {
9798
>
9899
{t(m.reload)}
99100
</Button>
101+
102+
<Button
103+
fullWidth
104+
variant="outlined"
105+
onClick={() => {
106+
router.navigate({
107+
href: buildDocumentReloadURL(router, '/'),
108+
reloadDocument: true,
109+
})
110+
}}
111+
sx={{ maxWidth: 400 }}
112+
>
113+
{t(m.restart)}
114+
</Button>
100115
</Box>
101116
</Stack>
102117
)
@@ -123,4 +138,9 @@ const m = defineMessages({
123138
defaultMessage: 'Reload',
124139
description: 'Text for button to reload page.',
125140
},
141+
restart: {
142+
id: 'components.generic-route-error-component.restart',
143+
defaultMessage: 'Restart',
144+
description: 'Text for button to restart app.',
145+
},
126146
})

0 commit comments

Comments
 (0)