mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-15 23:06:07 -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
|
@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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user