diff options
author | 2019-02-12 11:27:25 +0100 | |
---|---|---|
committer | 2019-02-12 11:27:25 +0100 | |
commit | afb6a91741c4c5ce9ef1e52266223faa35469d8b (patch) | |
tree | 4bfac28105b1340e17256242c1d6948cc546ac59 /src/index.js | |
parent | Merge branch 'master' into develop (diff) | |
download | ferdium-app-afb6a91741c4c5ce9ef1e52266223faa35469d8b.tar.gz ferdium-app-afb6a91741c4c5ce9ef1e52266223faa35469d8b.tar.zst ferdium-app-afb6a91741c4c5ce9ef1e52266223faa35469d8b.zip |
Fix windows token login
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/src/index.js b/src/index.js index 494fa97f1..a2b4acb00 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -74,21 +74,22 @@ if (!gotTheLock) { | |||
74 | mainWindow.focus(); | 74 | mainWindow.focus(); |
75 | 75 | ||
76 | if (isWindows) { | 76 | if (isWindows) { |
77 | // Keep only command line / deep linked arguments | 77 | onDidLoad((window) => { |
78 | const url = argv.slice(1); | 78 | // Keep only command line / deep linked arguments |
79 | 79 | const url = argv.slice(1); | |
80 | if (url) { | 80 | if (url) { |
81 | handleDeepLink(mainWindow, url.toString()); | 81 | handleDeepLink(window, url.toString()); |
82 | } | 82 | } |
83 | } | 83 | |
84 | 84 | if (argv.includes('--reset-window')) { | |
85 | if (argv.includes('--reset-window')) { | 85 | // Needs to be delayed to not interfere with mainWindow.restore(); |
86 | // Needs to be delayed to not interfere with mainWindow.restore(); | 86 | setTimeout(() => { |
87 | setTimeout(() => { | 87 | debug('Resetting windows via Task'); |
88 | debug('Resetting windows via Task'); | 88 | window.setPosition(DEFAULT_WINDOW_OPTIONS.x + 100, DEFAULT_WINDOW_OPTIONS.y + 100); |
89 | mainWindow.setPosition(DEFAULT_WINDOW_OPTIONS.x + 100, DEFAULT_WINDOW_OPTIONS.y + 100); | 89 | window.setSize(DEFAULT_WINDOW_OPTIONS.width, DEFAULT_WINDOW_OPTIONS.height); |
90 | mainWindow.setSize(DEFAULT_WINDOW_OPTIONS.width, DEFAULT_WINDOW_OPTIONS.height); | 90 | }, 1); |
91 | }, 1); | 91 | } |
92 | }); | ||
92 | } | 93 | } |
93 | } | 94 | } |
94 | }); | 95 | }); |
@@ -174,6 +175,16 @@ const createWindow = () => { | |||
174 | mainWindow.webContents.openDevTools(); | 175 | mainWindow.webContents.openDevTools(); |
175 | } | 176 | } |
176 | 177 | ||
178 | // Windows deep linking handling on app launch | ||
179 | if (isWindows) { | ||
180 | onDidLoad((window) => { | ||
181 | const url = process.argv.slice(1); | ||
182 | if (url) { | ||
183 | handleDeepLink(window, url.toString()); | ||
184 | } | ||
185 | }); | ||
186 | } | ||
187 | |||
177 | // Emitted when the window is closed. | 188 | // Emitted when the window is closed. |
178 | mainWindow.on('close', (e) => { | 189 | mainWindow.on('close', (e) => { |
179 | // Dereference the window object, usually you would store windows | 190 | // Dereference the window object, usually you would store windows |