notes API cleanup
This commit is contained in:
@@ -5,18 +5,18 @@ const api = {
|
||||
openNoteWindow: (noteId) => {
|
||||
ipcRenderer.send('open-note-window', noteId)
|
||||
},
|
||||
listNotes: () => ipcRenderer.invoke('notes:list'),
|
||||
createNote: (path, content) =>
|
||||
ipcRenderer.invoke('notes:create', { path, content }),
|
||||
createNoteDir: (path) => ipcRenderer.invoke('notes:createDir', path),
|
||||
readNote: (path) => ipcRenderer.invoke('notes:read', path),
|
||||
updateNote: (path, content) =>
|
||||
ipcRenderer.invoke('notes:update', { path, content }),
|
||||
}
|
||||
|
||||
// Implement notes API
|
||||
const notesAPI = {
|
||||
call: (method, ...args) =>
|
||||
ipcRenderer.invoke('notesAPI:call', method, args),
|
||||
}
|
||||
|
||||
if (process.contextIsolated) {
|
||||
try {
|
||||
contextBridge.exposeInMainWorld('api', api)
|
||||
contextBridge.exposeInMainWorld('notesAPI', notesAPI)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user