mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-06-28 12:08:09 +03:00
[FIX] initAfterGson selectedJava and fix texture upload
This commit is contained in:
parent
0a163bb09c
commit
cacbbfc8ed
2 changed files with 23 additions and 2 deletions
|
@ -26,7 +26,7 @@ public class ProfileSettingsImpl implements LauncherBackendAPI.ClientProfileSett
|
||||||
@LauncherNetworkAPI
|
@LauncherNetworkAPI
|
||||||
private String saveJavaPath;
|
private String saveJavaPath;
|
||||||
transient OptionalView view;
|
transient OptionalView view;
|
||||||
transient JavaHelper.JavaVersion selectedJava;
|
transient volatile JavaHelper.JavaVersion selectedJava;
|
||||||
|
|
||||||
public ProfileSettingsImpl() {
|
public ProfileSettingsImpl() {
|
||||||
}
|
}
|
||||||
|
@ -203,5 +203,21 @@ public void initAfterGson(ClientProfile profile, LauncherBackendImpl backend) {
|
||||||
}
|
}
|
||||||
enableOptional(opt, (var1, var2) -> {});
|
enableOptional(opt, (var1, var2) -> {});
|
||||||
}
|
}
|
||||||
|
if(this.saveJavaPath != null) {
|
||||||
|
backend.getAvailableJava().thenAccept((javas) -> {
|
||||||
|
for(var java : javas) {
|
||||||
|
if(!isCompatible(java)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(java.getPath() == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(java.getPath().toAbsolutePath().toString().equals(this.saveJavaPath)) {
|
||||||
|
this.selectedJava = (JavaHelper.JavaVersion) java;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package pro.gravit.launcher.base.request;
|
package pro.gravit.launcher.base.request;
|
||||||
|
|
||||||
import pro.gravit.launcher.base.Launcher;
|
import pro.gravit.launcher.base.Launcher;
|
||||||
|
import pro.gravit.launcher.base.events.request.AuthRequestEvent;
|
||||||
import pro.gravit.launcher.base.events.request.VerifySecureLevelKeyRequestEvent;
|
import pro.gravit.launcher.base.events.request.VerifySecureLevelKeyRequestEvent;
|
||||||
import pro.gravit.launcher.base.profiles.ClientProfile;
|
import pro.gravit.launcher.base.profiles.ClientProfile;
|
||||||
import pro.gravit.launcher.base.request.auth.*;
|
import pro.gravit.launcher.base.request.auth.*;
|
||||||
|
@ -62,7 +63,10 @@ public CompletableFuture<AuthResponse> auth(String login, AuthMethodPassword pas
|
||||||
connectType = AuthRequest.ConnectTypes.CLIENT;
|
connectType = AuthRequest.ConnectTypes.CLIENT;
|
||||||
}
|
}
|
||||||
return request.request(new AuthRequest(login, convertAuthPasswordAll(password), authId, false, connectType))
|
return request.request(new AuthRequest(login, convertAuthPasswordAll(password), authId, false, connectType))
|
||||||
.thenApply(response -> new AuthResponse(response.makeUserInfo(), response.oauth));
|
.thenApply(response -> {
|
||||||
|
Request.setOAuth(authId, response.oauth);
|
||||||
|
return new AuthResponse(response.makeUserInfo(), response.oauth);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private AuthRequest.AuthPasswordInterface convertAuthPasswordAll(AuthMethodPassword password) {
|
private AuthRequest.AuthPasswordInterface convertAuthPasswordAll(AuthMethodPassword password) {
|
||||||
|
@ -166,6 +170,7 @@ public CompletableFuture<SelfUser> restore(String accessToken, boolean fetchUser
|
||||||
}
|
}
|
||||||
return request.request(new RestoreRequest(authId, accessToken, extended, fetchUser)).thenApply(e -> {
|
return request.request(new RestoreRequest(authId, accessToken, extended, fetchUser)).thenApply(e -> {
|
||||||
// TODO: invalidToken process
|
// TODO: invalidToken process
|
||||||
|
Request.setOAuth(authId, new AuthRequestEvent.OAuthRequestEvent(accessToken, null, 0));
|
||||||
return e.userInfo;
|
return e.userInfo;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue