Fixed default folder icon
This commit is contained in:
@@ -68,7 +68,7 @@
|
|||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
// Fallback to default folder icon
|
// Fallback to default folder icon
|
||||||
folderIconSVG = getDefaultIconSVG('folder', plugin)
|
folderIconSVG = getDefaultIconSVG('folder')
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load file icon
|
// Load file icon
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
// Fallback to default icons based on file type
|
// Fallback to default icons based on file type
|
||||||
fileIconSVG = getDefaultIconSVG(note.path, plugin)
|
fileIconSVG = getDefaultIconSVG(note.path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -172,12 +172,13 @@ export async function loadIconSVG(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getDefaultIconSVG(
|
export function getDefaultIconSVG(notePath: string): string {
|
||||||
notePath: string,
|
|
||||||
plugin: OmnisearchPlugin
|
|
||||||
): string {
|
|
||||||
// Return SVG content for default icons based on file type
|
// Return SVG content for default icons based on file type
|
||||||
let iconName = 'file'
|
let iconName = 'file'
|
||||||
|
|
||||||
|
if (notePath === 'folder') {
|
||||||
|
iconName = 'folder'
|
||||||
|
} else {
|
||||||
if (isFileImage(notePath)) {
|
if (isFileImage(notePath)) {
|
||||||
iconName = 'image'
|
iconName = 'image'
|
||||||
} else if (isFilePDF(notePath)) {
|
} else if (isFilePDF(notePath)) {
|
||||||
@@ -185,6 +186,7 @@ export function getDefaultIconSVG(
|
|||||||
} else if (isFileCanvas(notePath) || isFileExcalidraw(notePath)) {
|
} else if (isFileCanvas(notePath) || isFileExcalidraw(notePath)) {
|
||||||
iconName = 'layout-dashboard'
|
iconName = 'layout-dashboard'
|
||||||
}
|
}
|
||||||
|
}
|
||||||
const iconEl = getIcon(iconName)
|
const iconEl = getIcon(iconName)
|
||||||
return iconEl ? iconEl.outerHTML : ''
|
return iconEl ? iconEl.outerHTML : ''
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user