mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-15 14:56:05 -04:00
fix(auth): OAuth login dialog logging state.
This commit is contained in:
parent
b5484bb13b
commit
ec3dfb908c
@ -67,14 +67,17 @@ public class OAuthAccountLoginDialog extends DialogPane {
|
||||
@Override
|
||||
protected void onAccept() {
|
||||
setLoading();
|
||||
|
||||
logging.set(true);
|
||||
Task.supplyAsync(account::logInWhenCredentialsExpired)
|
||||
.whenComplete(Schedulers.javafx(), authInfo -> {
|
||||
success.accept(authInfo);
|
||||
onSuccess();
|
||||
}, e -> {
|
||||
LOG.log(Level.INFO, "Failed to login when credentials expired: " + account, e);
|
||||
onFailure(Accounts.localizeErrorMessage(e));
|
||||
.whenComplete(Schedulers.javafx(), (authInfo, exception) -> {
|
||||
logging.set(false);
|
||||
if (exception == null) {
|
||||
success.accept(authInfo);
|
||||
onSuccess();
|
||||
} else {
|
||||
LOG.log(Level.INFO, "Failed to login when credentials expired: " + account, exception);
|
||||
onFailure(Accounts.localizeErrorMessage(exception));
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user