@@ -26,14 +26,17 @@ let authCode;
26
26
const protocol = isDev ? "overvuedev" : "overvue" ;
27
27
28
28
// Used to console log for main process in production mode
29
- // const deeplink = new Deeplink({
30
- // app,
31
- // mainWindow,
32
- // protocol,
33
- // isDev,
34
- // debugLogging: true,
35
- // // electronPath: '/node_modules/electron/dist/Electron.app'
36
- // });
29
+ // ** Only works on production level application; throws errors if you run quasar dev
30
+ if ( process . env . PROD ) {
31
+ const deeplink = new Deeplink ( {
32
+ app,
33
+ mainWindow,
34
+ protocol,
35
+ isDev,
36
+ debugLogging : true ,
37
+ // electronPath: '/node_modules/electron/dist/Electron.app'
38
+ } ) ;
39
+ }
37
40
38
41
// Sends request to Slack for User's information,
39
42
// then sends user information back to renderer process
@@ -105,17 +108,17 @@ function getSlackUser (token, userId) {
105
108
request . end ( )
106
109
}
107
110
108
- // function setOauthListener() {
109
- // // logEverywhere(`process.env.SLACK_CLIENT_ID in electron-main: ${process.env.SLACK_CLIENT_ID}`);
110
- // // logEverywhere(`process.env.SLACK_CLIENT_SECRET in electron-main: ${process.env.SLACK_CLIENT_SECRET}`);
111
+ function setOauthListener ( ) {
112
+ // logEverywhere(`process.env.SLACK_CLIENT_ID in electron-main: ${process.env.SLACK_CLIENT_ID}`);
113
+ // logEverywhere(`process.env.SLACK_CLIENT_SECRET in electron-main: ${process.env.SLACK_CLIENT_SECRET}`);
111
114
112
- // return deeplink.on("received", link => {
113
- // // logEverywhere(`auth worked here link: ${link}`);
114
- // // Extracts Slack authorization code from deep link
115
- // authCode = link.split("=")[1];
116
- // sendTokenRequest();
117
- // });
118
- // }
115
+ return deeplink . on ( "received" , link => {
116
+ // logEverywhere(`auth worked here link: ${link}`);
117
+ // Extracts Slack authorization code from deep link
118
+ authCode = link . split ( "=" ) [ 1 ] ;
119
+ sendTokenRequest ( ) ;
120
+ } ) ;
121
+ }
119
122
120
123
121
124
// ********************* Default *****************
@@ -163,6 +166,7 @@ app.on('window-all-closed', () => {
163
166
164
167
app . on ( 'activate' , ( ) => {
165
168
if ( mainWindow === null ) {
166
- createWindow ( )
169
+ createWindow ( ) ;
170
+ setOauthListener ( ) ;
167
171
}
168
172
} )
0 commit comments