(friendsCallback)
| 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 = { |
no test coverage detected