Secondary Google account (part5)

This commit is contained in:
benweet 2013-12-25 22:14:22 +01:00
parent 624a617102
commit 8a3075ee80
2 changed files with 5 additions and 4 deletions

View File

@ -153,9 +153,8 @@ define([
var immediate; var immediate;
function localAuthenticate() { function localAuthenticate() {
if(authuser > 5) { if(authuser > 5) {
authuser = 0; task.error(new Error('Unable to authenticate user ' + authorizationMgr.getUserId() + ', please sign in with Google.'));
immediate = false; return;
eventMgr.onError('Unable to authenticate user ' + authorizationMgr.getUserId() + ', please use login form.');
} }
if(immediate === false) { if(immediate === false) {
task.timeout = constants.ASYNC_TASK_LONG_TIMEOUT; task.timeout = constants.ASYNC_TASK_LONG_TIMEOUT;
@ -748,6 +747,7 @@ define([
var view; var view;
if(pickerType == 'doc') { if(pickerType == 'doc') {
view = new google.picker.DocsView(google.picker.ViewId.DOCS); view = new google.picker.DocsView(google.picker.ViewId.DOCS);
view.setParent('root');
view.setIncludeFolders(true); view.setIncludeFolders(true);
view.setMimeTypes([ view.setMimeTypes([
"text/x-markdown", "text/x-markdown",
@ -762,6 +762,7 @@ define([
} }
else if(pickerType == 'folder') { else if(pickerType == 'folder') {
view = new google.picker.DocsView(google.picker.ViewId.FOLDERS); view = new google.picker.DocsView(google.picker.ViewId.FOLDERS);
view.setParent('root');
view.setIncludeFolders(true); view.setIncludeFolders(true);
view.setSelectFolderEnabled(true); view.setSelectFolderEnabled(true);
view.setMimeTypes('application/vnd.google-apps.folder'); view.setMimeTypes('application/vnd.google-apps.folder');

View File

@ -508,7 +508,7 @@ define([
}); });
var state = utils.retrieveIgnoreError(providerId + ".state"); var state = utils.retrieveIgnoreError(providerId + ".state");
if(state === undefined) { if(state === undefined || state.userId != storage[accountId + '.userId']) {
return; return;
} }
storage.removeItem(providerId + ".state"); storage.removeItem(providerId + ".state");