(e)
| 1179 | let loadEvtCount = 0; |
| 1180 | |
| 1181 | function loadFinished(e) |
| 1182 | { |
| 1183 | if (e != null && !validateSender(e.senderFrame)) return null; |
| 1184 | |
| 1185 | loadEvtCount++; |
| 1186 | |
| 1187 | if (loadEvtCount == 2) |
| 1188 | { |
| 1189 | //Open the file if new app request is from opening a file |
| 1190 | var potFile = commandLine.pop(); |
| 1191 | |
| 1192 | if (fs.existsSync(potFile)) |
| 1193 | { |
| 1194 | // User intent: launched the app from CLI / file association |
| 1195 | // while another instance was already running. |
| 1196 | blessPath(potFile); |
| 1197 | win.webContents.send('args-obj', {args: [potFile]}); |
| 1198 | } |
| 1199 | } |
| 1200 | } |
| 1201 | |
| 1202 | //Order of these two events is not guaranteed, so wait for them async. |
| 1203 | //TOOD There is still a chance we catch another window 'app-load-finished' if user created multiple windows quickly |
no test coverage detected