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