reset dropbox client on change

This commit is contained in:
Antelle 2016-03-18 00:49:39 +03:00
parent cf20379c93
commit 3fa3c17291
3 changed files with 11 additions and 1 deletions

View File

@ -264,6 +264,10 @@ var DropboxLink = {
this._getClient(function(err) { complete(err); }, overrideAppKey);
},
resetClient: function() {
this._dropboxClient = null;
},
receive: function() {
Dropbox.AuthDriver.Popup.oauthReceiver();
},

View File

@ -110,6 +110,7 @@ var StorageDropbox = {
dropboxAppKey: config.key,
dropboxFolder: config.folder
});
DropboxLink.resetClient();
}
callback(err);
}, config.key);
@ -129,7 +130,10 @@ var StorageDropbox = {
case 'custom':
value = '(your app key)';
break;
default:
return;
}
DropboxLink.resetClient();
break;
case 'key':
key = 'dropboxAppKey';
@ -201,7 +205,8 @@ var StorageDropbox = {
rev: f.versionTag
};
});
var dir = dirStat.inAppFolder ? Locale.openAppFolder : UrlUtils.trimStartSlash(dirStat.path);
var dir = dirStat.inAppFolder ? Locale.openAppFolder :
(UrlUtils.trimStartSlash(dirStat.path) || Locale.openRootFolder);
callback(null, fileList, dir);
});
});

View File

@ -120,6 +120,7 @@ var Locale = {
openNothingFound: 'Nothing found',
openNothingFoundBody: 'No files which could be opened (files are searched inside {} folder).',
openAppFolder: 'app',
openRootFolder: 'root',
openSelectFile: 'Select a file',
openSelectFileBody: 'Select a file which you would like to open',
openPassFor: 'Password for',