Show "dashboard" icon for excalidraw files

This commit is contained in:
Simon Cambier
2024-06-20 18:34:54 +02:00
parent 6cd777ea73
commit 074a96fcff
4 changed files with 22 additions and 11 deletions
+12 -5
View File
@@ -3,7 +3,7 @@
import type { ResultNote } from '../globals'
import {
getExtension,
isFileCanvas,
isFileCanvas, isFileExcalidraw,
isFileImage,
isFilePDF,
pathWithoutFilename,
@@ -44,11 +44,18 @@
setIcon(elFolderPathIcon, 'folder-open')
}
if (elFilePathIcon) {
if (isFileImage(note.path)) setIcon(elFilePathIcon, 'image')
else if (isFilePDF(note.path)) setIcon(elFilePathIcon, 'file-text')
else if (isFileCanvas(note.path))
if (isFileImage(note.path)) {
setIcon(elFilePathIcon, 'image')
}
else if (isFilePDF(note.path)) {
setIcon(elFilePathIcon, 'file-text')
}
else if (isFileCanvas(note.path) || isFileExcalidraw(note.path)) {
setIcon(elFilePathIcon, 'layout-dashboard')
else setIcon(elFilePathIcon, 'file')
}
else {
setIcon(elFilePathIcon, 'file')
}
}
}
</script>