feat(client): display mapped icon as default for notes

This commit is contained in:
Elian Doran 2025-12-23 15:15:22 +02:00
parent 57ff2f4023
commit 2eef655ec2
No known key found for this signature in database

View File

@ -1,3 +1,5 @@
import { MIME_TYPES_DICT } from "@triliumnext/commons";
import cssClassManager from "../services/css_class_manager.js"; import cssClassManager from "../services/css_class_manager.js";
import type { Froca } from "../services/froca-interface.js"; import type { Froca } from "../services/froca-interface.js";
import noteAttributeCache from "../services/note_attribute_cache.js"; import noteAttributeCache from "../services/note_attribute_cache.js";
@ -597,8 +599,9 @@ export default class FNote {
return "bx bx-folder"; return "bx bx-folder";
} }
return "bx bx-note"; return "bx bx-note";
} else if (this.type === "code" && this.mime.startsWith("text/x-sql")) { } else if (this.type === "code") {
return "bx bx-data"; const correspondingMimeType = MIME_TYPES_DICT.find(m => m.mime === this.mime);
return correspondingMimeType?.icon ?? NOTE_TYPE_ICONS.code;
} }
return NOTE_TYPE_ICONS[this.type]; return NOTE_TYPE_ICONS[this.type];
} }