full notes file system architecture

This commit is contained in:
nicwands
2026-02-23 16:55:38 -05:00
parent 9ac9d73b0a
commit 0ab0620da8
12 changed files with 666 additions and 293 deletions

View File

@@ -1,6 +1,6 @@
import { electronApp, optimizer, is } from '@electron-toolkit/utils'
import { app, shell, BrowserWindow, ipcMain } from 'electron'
import notesAPI, { ensureBaseDir } from './notesAPI'
import NotesAPI from './notesAPI'
import { join } from 'path'
const preloadPath = join(__dirname, '../preload/index.js')
@@ -77,9 +77,6 @@ app.whenReady().then(() => {
// Create main window
createWindow()
// Ensure data directory is present
ensureBaseDir()
app.on('activate', function () {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
@@ -91,8 +88,10 @@ app.whenReady().then(() => {
createNoteWindow(noteId)
})
// Handle calls to Notes API
ipcMain.handle('notesAPI:call', async (_, method, args) => {
// Init Notes API
const notesAPI = new NotesAPI()
notesAPI.init()
ipcMain.handle('notesAPI:call', (_, method, args) => {
if (!notesAPI[method]) {
throw new Error('Invalid method')
}