Skip to content

Commit 81f6536

Browse files
committed
IONOS fix(Viewer): fix file type overwrite
Signed-off-by: Franziska Bath <[email protected]>
1 parent cab07a7 commit 81f6536

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/fileUtils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ const genFileInfo = function(obj: FileStat): FileInfo {
9494
Object.keys(obj).forEach(key => {
9595
const data = obj[key]
9696

97-
// flatten object if any
97+
// flatten object if any without overwriting type
9898
if (!!data && typeof data === 'object' && !Array.isArray(data)) {
99-
Object.assign(fileInfo, genFileInfo(data))
99+
Object.assign(fileInfo, genFileInfo(data), fileInfo["type"] ? { type: fileInfo["type"] } : {})
100100
} else {
101101
// format key and add it to the fileInfo
102102
if (data === 'false') {

0 commit comments

Comments
 (0)