1
1
// https://github.com/electron/electron/issues/10257
2
2
// Code fix to support NODE_EXTRA_CA_CERTS env. There is currently no other fixes to the NODE_TLS_REJECT_UNAUTHORIZED at the moment.
3
3
4
- ( function ( ) {
5
- if ( ! process . env . NODE_EXTRA_CA_CERTS ) return ;
6
- try {
7
- const extraca = require ( "fs" ) . readFileSync ( process . env . NODE_EXTRA_CA_CERTS ) ;
8
- } catch ( e ) {
9
- return ;
10
- }
11
-
12
- const NativeSecureContext = process . binding ( 'crypto' ) . SecureContext ;
13
- const oldaddRootCerts = NativeSecureContext . prototype . addRootCerts ;
14
- NativeSecureContext . prototype . addRootCerts = function ( ) {
15
- const ret = oldaddRootCerts . apply ( this , ...args ) ;
16
- this . addCACert ( extraca ) ;
17
- return ret ;
18
- } ;
4
+ ( function ( ) {
5
+ if ( ! process . env . NODE_EXTRA_CA_CERTS ) return ;
6
+ try {
7
+ const extraca = require ( 'fs' ) . readFileSync ( process . env . NODE_EXTRA_CA_CERTS ) ;
8
+ } catch ( e ) {
9
+ return ;
10
+ }
11
+
12
+ const NativeSecureContext = process . binding ( 'crypto' ) . SecureContext ;
13
+ const oldaddRootCerts = NativeSecureContext . prototype . addRootCerts ;
14
+ NativeSecureContext . prototype . addRootCerts = function ( ) {
15
+ const ret = oldaddRootCerts . apply ( this , ...args ) ;
16
+ this . addCACert ( extraca ) ;
17
+ return ret ;
18
+ } ;
19
19
} ) ( ) ;
20
20
21
21
// Allow self-signing HTTPS over TLS
@@ -85,7 +85,6 @@ if (process.argv.includes('--dev')) {
85
85
isDev = true ;
86
86
}
87
87
88
-
89
88
/** ***********************
90
89
******* MODE DISPLAY ****
91
90
************************ */
@@ -144,7 +143,7 @@ function createWindow() {
144
143
} ) ;
145
144
146
145
// Dev mode title
147
- mainWindow . setTitle ( " Swell (devMode)" )
146
+ mainWindow . setTitle ( ' Swell (devMode)' ) ;
148
147
149
148
// If we are in developer mode Add React & Redux DevTools to Electron App
150
149
installExtension ( REACT_DEVELOPER_TOOLS )
@@ -161,7 +160,6 @@ function createWindow() {
161
160
pathname : path . join ( __dirname , 'dist' , 'index.html' ) ,
162
161
slashes : true ,
163
162
} ) ;
164
-
165
163
}
166
164
167
165
// our new app window will load content depending on the boolean value of the dev variable
@@ -226,10 +224,9 @@ const sendStatusToWindow = (text) => {
226
224
} ;
227
225
228
226
ipcMain . on ( 'login-via-github' , async ( ) => {
229
- const url = `http://github.com/login/oauth/authorize?scope=repo&redirect_uri=http://localhost:3000/signup/github/callback/&client_id=6e9d37a09ab8bda68d50` // ${process.env.GITHUB_CLIENT_ID};
227
+ const url = `http://github.com/login/oauth/authorize?scope=repo&redirect_uri=http://localhost:3000/signup/github/callback/&client_id=6e9d37a09ab8bda68d50` ; // ${process.env.GITHUB_CLIENT_ID};
230
228
await shell . openExternal ( url , { activate : true } ) ;
231
-
232
- } )
229
+ } ) ;
233
230
234
231
ipcMain . on ( 'check-for-update' , ( ) => {
235
232
// listens to ipcRenderer in UpdatePopUpContainer.jsx
@@ -324,8 +321,8 @@ ipcMain.on('import-from-github', async (event, args) => {
324
321
// requiring typescript type Workspace makes sanitation uncessesary
325
322
const ids = { } ;
326
323
let index = 0 ;
327
- const newCollectionArr = [ ]
328
- for ( let collection of args ) {
324
+ const newCollectionArr = [ ] ;
325
+ for ( let collection of args ) {
329
326
// console.log('main.js workspace\n', workspace)
330
327
if ( ids [ collection . id ] ) {
331
328
const result = await popOverwrite ( collection ) ;
@@ -336,9 +333,8 @@ ipcMain.on('import-from-github', async (event, args) => {
336
333
}
337
334
ids [ collection . id ] = index ;
338
335
index ++ ;
339
- newCollectionArr . push ( collection )
340
-
341
- } ;
336
+ newCollectionArr . push ( collection ) ;
337
+ }
342
338
// send full array of workspaces to chromium for state update
343
339
event . sender . send ( 'add-collections' , newCollectionArr ) ;
344
340
} ) ;
0 commit comments