Fix #1272, Different-account warning with same username

If you swapped in a database with a different sync account from the
stored one and then opened the prefs, it would update the username to
match the username from the API key, and then when you synced it would
warn you using the new username for both accounts.

This stops the prefs from updating the username in the DB, so it only
happens during a sync.

(This behavior was put in in 77a95b5e6d, I guess so that if you open the
prefs twice before a sync it won't briefly show a missing/outdated
username after the first time, but that's not a big deal.)
This commit is contained in:
Dan Stillman 2017-10-03 01:44:45 -04:00
parent f880fd12d6
commit fcc366a176

View file

@ -47,7 +47,6 @@ Zotero_Preferences.Sync = {
{timeout: 5000}
);
this.displayFields(keyInfo.username);
Zotero.Users.setCurrentUsername(keyInfo.username);
}
catch (e) {
// API key wrong/invalid