From ae9c7a482c2bc8ce7ae318a9cf3acda5fb67115b Mon Sep 17 00:00:00 2001 From: Azalea Gui Date: Thu, 23 Feb 2023 15:13:58 -0500 Subject: [PATCH] [O] UI: Display provided mime if present in data --- src/App.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index 78ce560..c2da293 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -18,6 +18,7 @@ interface File { type: 'file' | 'directory' size: number mtime: string + mime?: string } // Placeholder for nginx to replace @@ -45,7 +46,7 @@ function getIcon(f: File) if (f.type == "directory") return urlJoin(deployPath, "mime/folder.svg") const sp = f.name.split(".") - const m = mime.getType(sp[sp.length - 1]) + const m = f.mime ?? mime.getType(sp[sp.length - 1]) if (m) return urlJoin(deployPath, `mime/${m.replace("/", "-")}.svg`) else return urlJoin(deployPath, 'mime/application-blank.svg') }