Skip to content

Commit 6181182

Browse files
authored
Merge branch 'dev' into graph
2 parents b4d1df3 + 1eaa980 commit 6181182

33 files changed

+580
-95
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@ ehthumbs.db
5858

5959
# proto files #
6060
#####################
61-
*.proto
61+
src/client/components/composer/protos
62+
*.proto

main.js

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ if (
118118
dev = true;
119119
}
120120

121+
121122
// Temporary fix broken high-dpi scale factor on Windows (125% scaling)
122123
// info: https://github.com/electron/electron/issues/9691
123124
if (process.platform === 'win32') {// if user is on windows...
@@ -168,6 +169,7 @@ function createWindow() {
168169
});
169170
}
170171
else {
172+
console.log('__dirname', __dirname);
171173
indexPath = url.format({// if we are not in dev mode load production build file
172174
protocol: 'file:',
173175
pathname: path.join(__dirname, 'dist', 'index.html'),
@@ -221,7 +223,7 @@ app.on('ready', () => {
221223
app.on('window-all-closed', () => {
222224
// On macOS it is common for applications and their menu bar
223225
// to stay active until the user quits explicitly with Cmd + Q
224-
if (process.platform !== 'darwin') {//darwin refers to macOS...
226+
if (process.platform !== 'darwin') {//darwin refers to macOS...
225227
app.quit();// If User is on mac exit the program when all windows are closed
226228
}
227229
});
@@ -268,6 +270,14 @@ autoUpdater.on('update-downloaded', info => {
268270
ipcMain.on('quit-and-install', () => {
269271
autoUpdater.quitAndInstall();
270272
});
273+
// App page reloads when user selects "Refresh" from pop-up dialog
274+
ipcMain.on('fatalError', () => {
275+
console.log('received fatal error')
276+
mainWindow.reload();
277+
});
278+
ipcMain.on('uncaughtException', () => {
279+
console.log('received uncaguht fatal error')
280+
});
271281

272282
app.on('activate', () => {
273283
// On macOS it's common to re-create a window in the app when the
@@ -287,13 +297,13 @@ ipcMain.on('export-collection', (event, args) => {
287297
return;
288298
}
289299

290-
// fileName is a string that contains the path and filename created in the save file dialog.
300+
// fileName is a string that contains the path and filename created in the save file dialog.
291301
fs.writeFile(resp.filePath, content, (err) => {
292302
if(err){
293303
console.log("An error ocurred creating the file "+ err.message)
294304
}
295305
})
296-
306+
297307
})})
298308

299309

@@ -349,10 +359,10 @@ ipcMain.on('import-collection', (event, args) => {
349359

350360
if (parsed) {
351361
// validate parsed data type and properties
352-
if (typeof parsed !== 'object' ||
353-
!parsed['id'] ||
354-
!parsed['name'] ||
355-
!parsed['reqResArray'] ||
362+
if (typeof parsed !== 'object' ||
363+
!parsed['id'] ||
364+
!parsed['name'] ||
365+
!parsed['reqResArray'] ||
356366
!parsed['created_at']) {
357367
options.message = 'Invalid File';
358368
options.detail = 'Please try again.';
@@ -368,7 +378,7 @@ ipcMain.on('import-collection', (event, args) => {
368378
})
369379

370380

371-
// ipcMain listener that
381+
// ipcMain listener that
372382
ipcMain.on('http1-fetch-message', (event, arg) => {
373383
const { method, headers, body } = arg.options;
374384

@@ -377,18 +387,18 @@ ipcMain.on('http1-fetch-message', (event, arg) => {
377387
const headers = response.headers.raw();
378388
// check if the endpoint sends SSE
379389
// add status code for regular http requests in the response header
380-
390+
381391
if (headers['content-type'][0].includes('stream')) {
382392
// invoke another func that fetches to SSE and reads stream
383393
// params: method, headers, body
384394
event.sender.send('http1-fetch-reply', { headers, body: { error: 'This Is An SSE endpoint' } })
385395
}
386396
else {
387397
headers[':status'] = response.status;
388-
398+
389399
const receivedCookie = headers['set-cookie'];
390400
headers.cookies = receivedCookie;
391-
401+
392402
const contents = /json/.test(response.headers.get('content-type')) ? response.json() : response.text();
393403
contents
394404
.then(body => {
@@ -441,7 +451,7 @@ ipcMain.on('open-gql', (event, args) => {
441451
const parsedRemainingCookieProperties = cookie.parse(thisCookie.slice(idx + 1));
442452

443453
const parsedCookie = {...parsedRemainingCookieProperties, name: keyValueArr[0], value: keyValueArr[1]};
444-
454+
445455
parsedCookies.push(parsedCookie);
446456
})
447457
reqResObj.response.cookies = parsedCookies;
@@ -487,4 +497,3 @@ ipcMain.on('open-gql', (event, args) => {
487497
});
488498
}
489499
});
490-

0 commit comments

Comments
 (0)