Skip to content

Commit

Permalink
Add a way to display error dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
heyman committed Jul 24, 2024
1 parent 95c2097 commit f156320
Show file tree
Hide file tree
Showing 9 changed files with 225 additions and 27 deletions.
4 changes: 4 additions & 0 deletions electron/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Menu.setApplicationMenu(menu)

export let win: BrowserWindow | null = null
let tray: Tray | null = null;
let initErrors: string[] = []
// Here, you can also use other preload
const preload = join(__dirname, '../preload/index.js')
const url = process.env.VITE_DEV_SERVER_URL
Expand Down Expand Up @@ -345,6 +346,9 @@ ipcMain.handle('dark-mode:get', () => nativeTheme.themeSource)

// load buffer on app start
loadBuffer()
ipcMain.handle("getInitErrors", () => {
return initErrors
})


ipcMain.handle('settings:set', async (event, settings) => {
Expand Down
6 changes: 5 additions & 1 deletion electron/preload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ contextBridge.exposeInMainWorld("heynote", {

async getVersion() {
return await ipcRenderer.invoke("getVersion")
}
},

async getInitErrors() {
return await ipcRenderer.invoke("getInitErrors")
},
})


Expand Down
88 changes: 62 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
},
"dependencies": {
"electron-log": "^5.0.1",
"pinia": "^2.1.7",
"semver": "^7.6.3"
}
}
Loading

0 comments on commit f156320

Please sign in to comment.