MCPcopy Create free account
hub / github.com/codecombat/codecombat / loadFriends

Method loadFriends

app/core/social-handlers/GPlusHandler.js:196–207  ·  view source on GitHub ↗
(friendsCallback)

Source from the content-addressed store, hash-verified

194 // Friends logic, not in use
195
196 loadFriends (friendsCallback) {
197 if (!this.loggedIn) { return friendsCallback() }
198 const expiresIn = this.accessToken ? parseInt(this.accessToken.expires_at) - (new Date().getTime() / 1000) : -1
199 const onReauthorized = () => gapi.client.request({ path: '/plus/v1/people/me/people/visible', callback: friendsCallback })
200 if (expiresIn < 0) {
201 // TODO: this tries to open a popup window, which might not ever finish or work, so the callback may never be called.
202 this.reauthorize()
203 return this.listenToOnce(this, 'logged-in', onReauthorized)
204 } else {
205 return onReauthorized()
206 }
207 }
208
209 reauthorize () {
210 const params = {

Callers 1

Calls 1

reauthorizeMethod · 0.95

Tested by

no test coverage detected