fix(auth): OAuth login dialog logging state.

This commit is contained in:
huanghongxun 2021-10-12 22:53:35 +08:00
parent b5484bb13b
commit ec3dfb908c

View File

@ -67,14 +67,17 @@ public class OAuthAccountLoginDialog extends DialogPane {
@Override @Override
protected void onAccept() { protected void onAccept() {
setLoading(); setLoading();
logging.set(true);
Task.supplyAsync(account::logInWhenCredentialsExpired) Task.supplyAsync(account::logInWhenCredentialsExpired)
.whenComplete(Schedulers.javafx(), authInfo -> { .whenComplete(Schedulers.javafx(), (authInfo, exception) -> {
logging.set(false);
if (exception == null) {
success.accept(authInfo); success.accept(authInfo);
onSuccess(); onSuccess();
}, e -> { } else {
LOG.log(Level.INFO, "Failed to login when credentials expired: " + account, e); LOG.log(Level.INFO, "Failed to login when credentials expired: " + account, exception);
onFailure(Accounts.localizeErrorMessage(e)); onFailure(Accounts.localizeErrorMessage(exception));
}
}).start(); }).start();
} }