Google Drive improvement

This commit is contained in:
RainLoop Team 2014-08-04 18:00:16 +04:00
parent d8bef79fc5
commit 409e9fbdc2
6 changed files with 184 additions and 154 deletions

View file

@ -1103,10 +1103,8 @@ PopupsComposeViewModel.prototype.driveOpenPopup = function ()
{
window.gapi.auth.authorize({
'client_id': RL.settingsGet('GoogleClientID'),
'scope': [
'https://www.googleapis.com/auth/drive.readonly'
].join(' '),
'immediate': false
'scope': 'https://www.googleapis.com/auth/drive.readonly',
'immediate': true
}, function (oAuthResult) {
if (oAuthResult && !oAuthResult.error)
{
@ -1116,6 +1114,23 @@ PopupsComposeViewModel.prototype.driveOpenPopup = function ()
self.driveCreatePiker(oAuthToken);
}
}
else
{
window.gapi.auth.authorize({
'client_id': RL.settingsGet('GoogleClientID'),
'scope': 'https://www.googleapis.com/auth/drive.readonly',
'immediate': false
}, function (oAuthResult) {
if (oAuthResult && !oAuthResult.error)
{
var oAuthToken = window.gapi.auth.getToken();
if (oAuthToken)
{
self.driveCreatePiker(oAuthToken);
}
}
});
}
});
}
else