Skip to content
This repository has been archived by the owner on Sep 22, 2021. It is now read-only.

Commit

Permalink
Added more logging to diagnose #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas101 committed Jan 15, 2016
1 parent c7d8b1b commit 5371c1e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,16 @@ class Analytics {
tid : credentials.GOOGLE_ANALYTICS_ID,
cid : this.id,
t : 'pageview',
ds : 'app',
vp : window.getSize().join('x'),
ul : osLanguage,
av : pkg.version,
aid : constants.APP_ID,
ua : window.webContents.getUserAgent()
}, args)

const qs = Object.keys(args).reduce((acc, k) => {
acc.push(k + '=' + encodeURIComponent(args[k]))
const qs = Object.keys(full_args).reduce((acc, k) => {
acc.push(k + '=' + encodeURIComponent(full_args[k]))
return acc
}, []).join('&')
console.log(qs)

const url = 'https://www.google-analytics.com/collect?' + qs
return fetch(url, { method: 'post' })
Expand All @@ -64,8 +62,7 @@ class Analytics {
if (!credentials.GOOGLE_ANALYTICS_ID) { return Promise.resolve() }
return this.send(window, {
dp : '/open/' + pkg.version,
dt : 'open',
sc : 'start'
dt : 'open'
})
}

Expand Down
5 changes: 5 additions & 0 deletions src/auth/googleAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ class GoogleAuth {
id : body.id,
auth : auth
})
}, err => {
evt.sender.send('auth-google-error', {
id : body.id,
error : err
})
})
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/mailbox/js/auth/googleAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ class GoogleAuthClient {
constructor() {
this.requests = {}
ipcRenderer.on('auth-google-complete', (evt, body) => {
console.log('[AUTH SUCCESS]', body)
this.requests[body.id](evt, body)
delete this.requests[body.id]
})
ipcRenderer.on('auth-google-error', (evt, body) => {
console.log('[AUTH ERROR]', body)
delete this.requests[body.id]
})
}

/*****************************************************************************/
Expand Down

0 comments on commit 5371c1e

Please sign in to comment.