read prefs only when ready
This commit is contained in:
parent
f9e3e1e80c
commit
86204ad2ad
|
@ -63,9 +63,9 @@ const syncMan = (() => {
|
|||
return status;
|
||||
},
|
||||
|
||||
async login(name = prefs.get('sync.enabled')) {
|
||||
// FIXME: it doesn't really make sense to wait pref after getting the pref value
|
||||
async login(name) {
|
||||
if (ready.then) await ready;
|
||||
if (!name) name = prefs.get('sync.enabled');
|
||||
await tokenMan.revokeToken(name);
|
||||
try {
|
||||
await tokenMan.getToken(name, true);
|
||||
|
|
Loading…
Reference in New Issue
Block a user