@@ -168,6 +168,7 @@ function createWindow() {
168168 } ) ;
169169 }
170170 else {
171+ console . log ( '__dirname' , __dirname ) ;
171172 indexPath = url . format ( { // if we are not in dev mode load production build file
172173 protocol : 'file:' ,
173174 pathname : path . join ( __dirname , 'dist' , 'index.html' ) ,
@@ -221,7 +222,7 @@ app.on('ready', () => {
221222app . on ( 'window-all-closed' , ( ) => {
222223 // On macOS it is common for applications and their menu bar
223224 // to stay active until the user quits explicitly with Cmd + Q
224- if ( process . platform !== 'darwin' ) { //darwin refers to macOS...
225+ if ( process . platform !== 'darwin' ) { //darwin refers to macOS...
225226 app . quit ( ) ; // If User is on mac exit the program when all windows are closed
226227 }
227228} ) ;
@@ -287,13 +288,13 @@ ipcMain.on('export-collection', (event, args) => {
287288 return ;
288289 }
289290
290- // fileName is a string that contains the path and filename created in the save file dialog.
291+ // fileName is a string that contains the path and filename created in the save file dialog.
291292 fs . writeFile ( resp . filePath , content , ( err ) => {
292293 if ( err ) {
293294 console . log ( "An error ocurred creating the file " + err . message )
294295 }
295296 } )
296-
297+
297298 } ) } )
298299
299300
@@ -349,10 +350,10 @@ ipcMain.on('import-collection', (event, args) => {
349350
350351 if ( parsed ) {
351352 // validate parsed data type and properties
352- if ( typeof parsed !== 'object' ||
353- ! parsed [ 'id' ] ||
354- ! parsed [ 'name' ] ||
355- ! parsed [ 'reqResArray' ] ||
353+ if ( typeof parsed !== 'object' ||
354+ ! parsed [ 'id' ] ||
355+ ! parsed [ 'name' ] ||
356+ ! parsed [ 'reqResArray' ] ||
356357 ! parsed [ 'created_at' ] ) {
357358 options . message = 'Invalid File' ;
358359 options . detail = 'Please try again.' ;
@@ -368,7 +369,7 @@ ipcMain.on('import-collection', (event, args) => {
368369} )
369370
370371
371- // ipcMain listener that
372+ // ipcMain listener that
372373ipcMain . on ( 'http1-fetch-message' , ( event , arg ) => {
373374 const { method, headers, body } = arg . options ;
374375
@@ -377,18 +378,18 @@ ipcMain.on('http1-fetch-message', (event, arg) => {
377378 const headers = response . headers . raw ( ) ;
378379 // check if the endpoint sends SSE
379380 // add status code for regular http requests in the response header
380-
381+
381382 if ( headers [ 'content-type' ] [ 0 ] . includes ( 'stream' ) ) {
382383 // invoke another func that fetches to SSE and reads stream
383384 // params: method, headers, body
384385 event . sender . send ( 'http1-fetch-reply' , { headers, body : { error : 'This Is An SSE endpoint' } } )
385386 }
386387 else {
387388 headers [ ':status' ] = response . status ;
388-
389+
389390 const receivedCookie = headers [ 'set-cookie' ] ;
390391 headers . cookies = receivedCookie ;
391-
392+
392393 const contents = / j s o n / . test ( response . headers . get ( 'content-type' ) ) ? response . json ( ) : response . text ( ) ;
393394 contents
394395 . then ( body => {
@@ -441,7 +442,7 @@ ipcMain.on('open-gql', (event, args) => {
441442 const parsedRemainingCookieProperties = cookie . parse ( thisCookie . slice ( idx + 1 ) ) ;
442443
443444 const parsedCookie = { ...parsedRemainingCookieProperties , name : keyValueArr [ 0 ] , value : keyValueArr [ 1 ] } ;
444-
445+
445446 parsedCookies . push ( parsedCookie ) ;
446447 } )
447448 reqResObj . response . cookies = parsedCookies ;
@@ -487,4 +488,3 @@ ipcMain.on('open-gql', (event, args) => {
487488 } ) ;
488489 }
489490} ) ;
490-
0 commit comments