Fixed default folder icon
This commit is contained in:
@@ -68,7 +68,7 @@
|
||||
)
|
||||
} else {
|
||||
// Fallback to default folder icon
|
||||
folderIconSVG = getDefaultIconSVG('folder', plugin)
|
||||
folderIconSVG = getDefaultIconSVG('folder')
|
||||
}
|
||||
|
||||
// Load file icon
|
||||
@@ -82,7 +82,7 @@
|
||||
)
|
||||
} else {
|
||||
// Fallback to default icons based on file type
|
||||
fileIconSVG = getDefaultIconSVG(note.path, plugin)
|
||||
fileIconSVG = getDefaultIconSVG(note.path)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -172,18 +172,20 @@ export async function loadIconSVG(
|
||||
}
|
||||
}
|
||||
|
||||
export function getDefaultIconSVG(
|
||||
notePath: string,
|
||||
plugin: OmnisearchPlugin
|
||||
): string {
|
||||
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 : ''
|
||||
|
||||
Reference in New Issue
Block a user