only save username to prefs on successful login (#3192)
Failing to login does not update the username in prefs. Fixes #2901
This commit is contained in:
parent
13571f9fd2
commit
04496fadcd
2 changed files with 3 additions and 4 deletions
|
@ -125,8 +125,6 @@ Zotero_Preferences.Sync = {
|
|||
var trimmed = username.trim();
|
||||
if (username != trimmed) {
|
||||
tb.value = trimmed;
|
||||
// Setting .value alone doesn't seem to cause the pref to sync, so set it manually
|
||||
Zotero.Prefs.set('sync.server.username', trimmed);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -181,7 +179,9 @@ Zotero_Preferences.Sync = {
|
|||
Zotero.Sync.Runner.deleteAPIKey();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Zotero.Prefs.set('sync.server.username', username);
|
||||
|
||||
// It shouldn't be possible for a sync to be in progress if the user wasn't logged in,
|
||||
// but check to be sure
|
||||
if (!Zotero.Sync.Runner.syncInProgress) {
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
<html:div class="form-grid">
|
||||
<label value="&zotero.preferences.sync.username;"/>
|
||||
<html:input id="sync-username-textbox"
|
||||
preference="extensions.zotero.sync.server.username"
|
||||
onblur="Zotero_Preferences.Sync.trimUsername()"
|
||||
oninput="Zotero_Preferences.Sync.credentialsChange(event)"
|
||||
onchange="Zotero_Preferences.Sync.credentialsChange(event)"
|
||||
|
|
Loading…
Add table
Reference in a new issue