|
|
|
|
@ -1,4 +1,5 @@ |
|
|
|
|
import { Box, States, StatesAction, StatesActions, StatesIcon, StatesSubtitle, StatesTitle } from '@rocket.chat/fuselage'; |
|
|
|
|
import { Box, PaletteStyleTag, States, StatesAction, StatesActions, StatesIcon, StatesSubtitle, StatesTitle } from '@rocket.chat/fuselage'; |
|
|
|
|
import { useThemeMode } from '@rocket.chat/ui-theming'; |
|
|
|
|
import type { ErrorInfo, ReactElement } from 'react'; |
|
|
|
|
|
|
|
|
|
type AppErrorPageProps = { |
|
|
|
|
@ -8,30 +9,35 @@ type AppErrorPageProps = { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const AppErrorPage = (_props: AppErrorPageProps): ReactElement => { |
|
|
|
|
const [, , theme] = useThemeMode(); |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<Box display='flex' justifyContent='center' height='full' backgroundColor='surface'> |
|
|
|
|
<States> |
|
|
|
|
<StatesIcon name='error-circle' /> |
|
|
|
|
<StatesTitle>Application Error</StatesTitle> |
|
|
|
|
<StatesSubtitle>The application GUI just crashed.</StatesSubtitle> |
|
|
|
|
<> |
|
|
|
|
<PaletteStyleTag theme={theme} tagId='app-error-palette' /> |
|
|
|
|
<Box display='flex' justifyContent='center' height='full' backgroundColor='surface'> |
|
|
|
|
<States> |
|
|
|
|
<StatesIcon name='error-circle' /> |
|
|
|
|
<StatesTitle>Application Error</StatesTitle> |
|
|
|
|
<StatesSubtitle>The application GUI just crashed.</StatesSubtitle> |
|
|
|
|
|
|
|
|
|
<StatesActions> |
|
|
|
|
<StatesAction |
|
|
|
|
onClick={() => { |
|
|
|
|
const result = indexedDB.deleteDatabase('MeteorDynamicImportCache'); |
|
|
|
|
result.onsuccess = () => { |
|
|
|
|
window.location.reload(); |
|
|
|
|
}; |
|
|
|
|
result.onerror = () => { |
|
|
|
|
window.location.reload(); |
|
|
|
|
}; |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
Reload Application |
|
|
|
|
</StatesAction> |
|
|
|
|
</StatesActions> |
|
|
|
|
</States> |
|
|
|
|
</Box> |
|
|
|
|
<StatesActions> |
|
|
|
|
<StatesAction |
|
|
|
|
onClick={() => { |
|
|
|
|
const result = indexedDB.deleteDatabase('MeteorDynamicImportCache'); |
|
|
|
|
result.onsuccess = () => { |
|
|
|
|
window.location.reload(); |
|
|
|
|
}; |
|
|
|
|
result.onerror = () => { |
|
|
|
|
window.location.reload(); |
|
|
|
|
}; |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
Reload Application |
|
|
|
|
</StatesAction> |
|
|
|
|
</StatesActions> |
|
|
|
|
</States> |
|
|
|
|
</Box> |
|
|
|
|
</> |
|
|
|
|
); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|