Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/big-bees-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': minor
---

Adds theme palette to Application error page
52 changes: 29 additions & 23 deletions apps/meteor/client/views/root/AppErrorPage.tsx
Original file line number Diff line number Diff line change
@@ -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 = {
Expand All @@ -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>
</>
);
};

Expand Down
Loading