Index base files (#480)
* Index base files * Do not index bases content --------- Co-authored-by: Simon Cambier <simon.cambier@protonmail.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
import {
|
||||
getExtension,
|
||||
isFileCanvas,
|
||||
isFileBase,
|
||||
isFileExcalidraw,
|
||||
isFileImage,
|
||||
isFilePDF,
|
||||
@@ -135,7 +136,7 @@
|
||||
setIcon(elFilePathIcon, 'image')
|
||||
} else if (isFilePDF(note.path)) {
|
||||
setIcon(elFilePathIcon, 'file-text')
|
||||
} else if (isFileCanvas(note.path) || isFileExcalidraw(note.path)) {
|
||||
} else if (isFileCanvas(note.path) || isFileExcalidraw(note.path) || isFileBase(note.path)) {
|
||||
setIcon(elFilePathIcon, 'layout-dashboard')
|
||||
} else {
|
||||
setIcon(elFilePathIcon, 'file')
|
||||
|
||||
@@ -4,6 +4,7 @@ import { removeAnchors } from './tools/notes'
|
||||
import type { IndexedDocument } from './globals'
|
||||
import {
|
||||
isFileCanvas,
|
||||
isFileBase,
|
||||
isFileFromDataloom,
|
||||
isFileImage,
|
||||
isFilePDF,
|
||||
@@ -63,6 +64,7 @@ export class NotesIndexer {
|
||||
this.canIndexUnsupportedFiles() ||
|
||||
this.isFilePlaintext(path) ||
|
||||
isFileCanvas(path) ||
|
||||
isFileBase(path) ||
|
||||
isFileFromDataloom(path)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
isFileImage,
|
||||
isFilePDF,
|
||||
isFileCanvas,
|
||||
isFileBase,
|
||||
isFileExcalidraw,
|
||||
warnVerbose,
|
||||
} from './utils'
|
||||
@@ -183,7 +184,7 @@ export function getDefaultIconSVG(notePath: string): string {
|
||||
iconName = 'image'
|
||||
} else if (isFilePDF(notePath)) {
|
||||
iconName = 'file-text'
|
||||
} else if (isFileCanvas(notePath) || isFileExcalidraw(notePath)) {
|
||||
} else if (isFileCanvas(notePath) || isFileExcalidraw(notePath) || isFileBase(notePath)) {
|
||||
iconName = 'layout-dashboard'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,6 +178,10 @@ export function isFileCanvas(path: string): boolean {
|
||||
return path.endsWith('.canvas')
|
||||
}
|
||||
|
||||
export function isFileBase(path: string): boolean {
|
||||
return path.endsWith('.base')
|
||||
}
|
||||
|
||||
export function isFileExcalidraw(path: string): boolean {
|
||||
return path.endsWith('.excalidraw')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user