mirror of
https://github.com/heyman/heynote.git
synced 2025-08-16 09:38:04 +02:00
WIP: Create new node dialog
Implement folder selector UI element. Retrieve actual folder structure from Notes library.
This commit is contained in:
@ -67,7 +67,7 @@ export class FileLibrary {
|
||||
async getList() {
|
||||
console.log("Loading notes")
|
||||
const notes = {}
|
||||
const files = await this.jetpack.findAsync(this.basePath, {
|
||||
const files = await this.jetpack.findAsync(".", {
|
||||
matching: "*.txt",
|
||||
recursive: true,
|
||||
})
|
||||
@ -83,6 +83,15 @@ export class FileLibrary {
|
||||
return notes
|
||||
}
|
||||
|
||||
async getDirectoryList() {
|
||||
const directories = await this.jetpack.findAsync("", {
|
||||
files: false,
|
||||
directories: true,
|
||||
recursive: true,
|
||||
})
|
||||
return directories
|
||||
}
|
||||
|
||||
setupWatcher(win) {
|
||||
if (!this.watcher) {
|
||||
this.watcher = fs.watch(
|
||||
@ -189,6 +198,10 @@ export function setupFileLibraryEventHandlers(library, win) {
|
||||
return await library.getList()
|
||||
});
|
||||
|
||||
ipcMain.handle('buffer:getDirectoryList', async (event) => {
|
||||
return await library.getDirectoryList()
|
||||
});
|
||||
|
||||
ipcMain.handle('buffer:exists', async (event, path) => {
|
||||
return await library.exists(path)
|
||||
});
|
||||
|
Reference in New Issue
Block a user