From 282fd1be1349dee70174bba76be56b3233811255 Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Wed, 25 Jun 2025 21:49:52 +0200 Subject: [PATCH] Fixed icons bug --- src/tools/icon-utils.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/tools/icon-utils.ts b/src/tools/icon-utils.ts index 46fc69b..cfb5e38 100644 --- a/src/tools/icon-utils.ts +++ b/src/tools/icon-utils.ts @@ -1,20 +1,20 @@ import { getIcon } from 'obsidian' -import { - isFileCanvas, - isFileExcalidraw, - isFileImage, - isFilePDF -} from './utils' +import { isFileCanvas, isFileExcalidraw, isFileImage, isFilePDF } from './utils' export function getDefaultIconSVG(notePath: string): string { // Return SVG content for default icons based on file type let iconName = 'file' - if (isFileImage(notePath)) { - iconName = 'image' - } else if (isFilePDF(notePath)) { - iconName = 'file-text' - } else if (isFileCanvas(notePath) || isFileExcalidraw(notePath)) { - iconName = 'layout-dashboard' + + if (notePath === 'folder') { + iconName = 'folder' + } else { + if (isFileImage(notePath)) { + iconName = 'image' + } else if (isFilePDF(notePath)) { + iconName = 'file-text' + } else if (isFileCanvas(notePath) || isFileExcalidraw(notePath)) { + iconName = 'layout-dashboard' + } } const iconEl = getIcon(iconName) return iconEl ? iconEl.outerHTML : ''