Skip to content

Commit f32395f

Browse files
authored
Merge pull request #103 from navikt/html-bug
Fjern html som default, ikke vis noe hvis ikke innhold
2 parents 2a6de4f + c7dc9a9 commit f32395f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

xp-archive/client/content/Content.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export const Content = () => {
9292
</div>
9393
</div>
9494
<ContentView
95-
selectedView={selectedView || getDefaultView(isWebpage, hasAttachment) || 'html'}
95+
selectedView={selectedView || getDefaultView(isWebpage, hasAttachment)}
9696
isLoading={isLoading}
9797
data={data}
9898
/>

xp-archive/client/contentView/ContentView.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import { FilePreviewWrapper } from './filePreview/FilePreviewWrapper';
88

99
import style from './ContentView.module.css';
1010

11-
const getDisplayComponent = (viewVariant: ViewVariant, data?: ContentServiceResponse | null) => {
12-
if (!data) return null;
11+
const getDisplayComponent = (viewVariant?: ViewVariant, data?: ContentServiceResponse | null) => {
12+
if (!data || !viewVariant) return null;
1313
const components: Record<ViewVariant, React.ReactElement> = {
1414
html: (
1515
<HtmlView
@@ -25,7 +25,7 @@ const getDisplayComponent = (viewVariant: ViewVariant, data?: ContentServiceResp
2525
};
2626

2727
type Props = {
28-
selectedView: ViewVariant;
28+
selectedView: ViewVariant | undefined;
2929
isLoading: boolean;
3030
data?: ContentServiceResponse | null;
3131
};

0 commit comments

Comments
 (0)