fix: custom icon on some files was not working
Massimo Melina committed
May 16, 2026 at 18:57 UTC
16f3a7ffbb524734a3c8523b978514f5bd397990
2 files changed
+2
-2
frontend/src/state.ts
+1
-1
@@ -150,7 +150,7 @@ export class DirEntry implements ServerDirEntry {
150
}
151
152
getDefaultIcon() {
153
- return hIcon(this.icon === true ? `${this.n}?get=icon` : (this.icon ?? (this.isFolder || this.web ? 'folder' : this.url ? 'link' : ext2type(this.ext) || 'file')))
153
+ return hIcon(this.icon === true ? `${this.uri}?get=icon` : (this.icon ?? (this.isFolder || this.web ? 'folder' : this.url ? 'link' : ext2type(this.ext) || 'file')))
154
}
155
156
canArchive() {
src/api.get_file_list.ts
+1
-1
@@ -110,7 +110,7 @@ export const get_file_list: ApiHandler = async ({ uri='/', offset, limit, c, onl
110
}
111
112
function getNodeIcon(node: VfsNode) {
113
- return node.icon?.includes('.') || node.icon // true = specific for this file, otherwise is a SYS_ICONS
113
+ return node.icon?.includes('.') || node.icon // send just true when the icon is specific and must be retrieved by the frontend with ?get=icon, otherwise is a SYS_ICONS
114
}
115
116
async function nodeToDirEntry(ctx: Koa.Context, node: VfsNode): Promise<DirEntry | null> {