Skip to content

Commit 31c85b8

Browse files
committed
fix: Allow opening an empty file
1 parent f741a85 commit 31c85b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/features/instance/applications/context/EditorViewProvider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,14 @@ export function EditorViewProvider({ children }: PropsWithChildren) {
130130
const loadedPath = getComponentFileQueryData?.project + '/' + getComponentFileQueryData?.file;
131131
let contents = getComponentFileQueryData?.message;
132132
if (
133-
loadedPath === pathToLoad && contents
133+
loadedPath === pathToLoad && contents !== undefined
134134
) {
135135
const baseURL = instanceParams.instanceClient.defaults.baseURL;
136136
if (loadedOverviewEntry && baseURL && getComponentFileQueryData) {
137137
contents = parseReadMe(contents, baseURL, getComponentFileQueryData);
138138
}
139139
// eslint-disable-next-line react-hooks/set-state-in-effect
140-
setOpenedEntryContents(contents || undefined);
140+
setOpenedEntryContents(contents);
141141
} else {
142142
setOpenedEntryContents(undefined);
143143
}

0 commit comments

Comments
 (0)