Skip to content

Commit

Permalink
fix: fix feedback board that shows blank page
Browse files Browse the repository at this point in the history
refs: SHELL-112 (#258)
  • Loading branch information
rodleyorosa authored Jun 5, 2023
1 parent 5a90125 commit ef69922
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/shell/boards/board-container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ interface ListItemContentProps {
icon?: string;
label: string;
selected?: boolean;
app: string;
app?: string;
boardId: string;
}

Expand All @@ -117,9 +117,10 @@ function ListItemContent({
{label}
</Text>
<Text size={'small'} weight={selected ? 'bold' : 'regular'} color={'secondary'}>
{t('board.from_app', 'From {{app}}', {
app
})}
{app &&
t('board.from_app', 'From {{app}}', {
app
})}
</Text>
</OverflowContainer>
<IconButton icon={'CloseOutline'} size={'large'} onClick={onClose} />
Expand All @@ -146,7 +147,7 @@ export const BoardContainer: FC = () => {
label={boards[boardId].title}
icon={boards[boardId].icon}
selected={boardId === current}
app={getApp(boards[boardId].app)().display}
app={getApp(boards[boardId].app)()?.display}
boardId={boardId}
/>
)
Expand Down
3 changes: 2 additions & 1 deletion src/store/app/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export const useAppList = (): Array<CarbonioModule> => {
export const getAppList = (): Array<CarbonioModule> =>
sortBy(useAppStore.getState().apps, (a) => a.priority);

export const getApp = (appId: string) => (): CarbonioModule => useAppStore.getState().apps[appId];
export const getApp = (appId: string) => (): CarbonioModule | undefined =>
useAppStore.getState().apps[appId];
export const getApps = (): Record<string, CarbonioModule> => useAppStore.getState().apps;

export const useAppContext = (appId: string) => (): unknown =>
Expand Down

0 comments on commit ef69922

Please sign in to comment.