Skip to content

Commit

Permalink
fix undefined window width/height
Browse files Browse the repository at this point in the history
  • Loading branch information
kumakichi committed Apr 23, 2024
1 parent 427a05c commit f27e25b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"webpack": "^4.46.0"
},
"name": "Deepl-Linux-Electron",
"version": "1.4.2",
"version": "1.4.3",
"scripts": {
"dev": "electron-webpack dev",
"compile": "electron-webpack",
Expand Down
8 changes: 5 additions & 3 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ let gShortcut;

let isRemoveLineBreaks = false;
let isHiddenOnStartup = false;
let windowWidth = 800;
let windowHeight = 600;
let windowWidth;
let windowHeight;

const Store = require('electron-store');
const store = new Store();
Expand Down Expand Up @@ -150,7 +150,9 @@ app.on('ready', function() {
});

console.log("============ restore window size:", windowWidth, 'x', windowHeight)
win.setSize(parseInt(windowWidth,10), parseInt(windowHeight,10), false)
if (windowWidth && windowHeight) {
win.setSize(parseInt(windowWidth,10), parseInt(windowHeight,10), false)
}

win.loadURL("https://www.deepl.com/translator", {
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36'
Expand Down

0 comments on commit f27e25b

Please sign in to comment.