Skip to content

Commit

Permalink
Merge pull request #12 from ma-ray/handle-links-in-editor
Browse files Browse the repository at this point in the history
Handle links in editor
  • Loading branch information
ma-ray authored Jan 4, 2024
2 parents a3c657b + 58b5940 commit 8831e42
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion electron/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { app, BrowserWindow, ipcMain } from 'electron'
import { app, BrowserWindow, ipcMain, shell } from 'electron'
import path from 'node:path'
import {
doesDiaryDayExist,
Expand Down Expand Up @@ -48,6 +48,11 @@ function createWindow() {
// win.loadFile('dist/index.html')
win.loadFile(path.join(process.env.DIST, 'index.html'))
}

win.webContents.setWindowOpenHandler((details) => {
shell.openExternal(details.url)
return { action: 'deny' }
})
}

// Quit when all windows are closed, except on macOS. There, it's common
Expand Down

0 comments on commit 8831e42

Please sign in to comment.