Closes #886, Fixes auth form showing until key info check finishes

This commit is contained in:
Adomas Venčkauskas 2015-12-22 15:33:38 +00:00
parent ec72dd3909
commit 77a95b5e6d

View file

@ -30,7 +30,7 @@ Zotero_Preferences.Sync = {
init: Zotero.Promise.coroutine(function* () {
this.updateStorageSettingsUI();
var username = Zotero.Users.getCurrentUsername() || "";
var username = Zotero.Users.getCurrentUsername() || Zotero.Prefs.get('sync.server.username') || " ";
var apiKey = Zotero.Sync.Data.Local.getAPIKey();
this.displayFields(apiKey ? username : "");
@ -46,6 +46,7 @@ Zotero_Preferences.Sync = {
{timeout: 5000}
);
this.displayFields(keyInfo.username);
Zotero.Users.setCurrentUsername(keyInfo.username);
}
catch (e) {
// API key wrong/invalid