Skip to content

Commit

Permalink
- Fix Windows bug when reopen running
Browse files Browse the repository at this point in the history
- Upgade Electron
  • Loading branch information
Rustem Mussabekov committed Aug 1, 2022
1 parent 5a97284 commit d8fd762
Show file tree
Hide file tree
Showing 5 changed files with 399 additions and 472 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"lodash": "^4.17.20"
},
"devDependencies": {
"electron": "17.3.x",
"electron": "19.0.x",
"electron-builder": "^23.0.3",
"electron-builder-squirrel-windows": "^23.0.4",
"electron-notarize": "^1.2.1",
Expand Down
12 changes: 7 additions & 5 deletions src/deeplink.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ module.exports = function(window) {

function onDeepLink(url) {
if (!url) return
window.window.show()

//otherwise shutdown for no reason :(
if (process.platform=='linux')
dialog.showMessageBoxSync(window.window, { message: 'Deeplink received!', type: 'none' })
if (String(url).startsWith(`${protocol}:/`)) {
//otherwise shutdown for no reason :(
if (process.platform=='linux')
dialog.showMessageBoxSync(window.window, { message: 'Deeplink received!', type: 'none' })

window.window.show()
window.setPath(url.replace(`${protocol}:/`, ''))
window.setPath(url.replace(`${protocol}:/`, ''))
}
}

//on windows deeplinks handeled differently
Expand Down
3 changes: 2 additions & 1 deletion src/webview/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const { app } = require('electron')
const path = require("path");

function onWillAttachWebview(_, webPreferences) {
//preload highligh script for all webview's
webPreferences.preloadURL = `file://${__dirname}/highlight.js`
webPreferences.preload = path.join(__dirname, "highlight.js")
}

module.exports = function() {
Expand Down
2 changes: 1 addition & 1 deletion webapp
Submodule webapp updated 1 files
+1 −1 package.json
Loading

0 comments on commit d8fd762

Please sign in to comment.