merge main (#196)
Co-authored-by: str1k3r <115313679+S1l3ntStr1ke87@users.noreply.github.com>
|
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 59 KiB |
|
|
@ -45,7 +45,7 @@ export const BASE_EDITIONS = [
|
|||
url: "https://git.revela.dev/itsRevela/LCE-Revelations/releases/download/Nightly/LCE-Revelations-Client-Win64.zip",
|
||||
titleImage: "/images/minecraft_title_revelations.png",
|
||||
supportsSlimSkins: false,
|
||||
panorama: "vanilla_tu24",
|
||||
panorama: "vanilla_tu19",
|
||||
logo: "/images/revelations.png",
|
||||
},
|
||||
/*{
|
||||
|
|
|
|||
|
|
@ -36,9 +36,6 @@ export class LceOnlineService {
|
|||
private _listeners: Array<() => void> = [];
|
||||
constructor() {
|
||||
this.loadSession();
|
||||
if (this._session) {
|
||||
this.refreshToken();
|
||||
}
|
||||
}
|
||||
|
||||
onSessionChange(listener: () => void): () => void {
|
||||
|
|
@ -212,28 +209,6 @@ export class LceOnlineService {
|
|||
return data;
|
||||
}
|
||||
|
||||
async refreshToken(): Promise<boolean> {
|
||||
if (!this._session) return false;
|
||||
|
||||
try {
|
||||
const res = await this.request<string>("POST", "/refreshtoken", null, AUTH_BASE_URL);
|
||||
if (typeof res === "string" && res.startsWith("-")) {
|
||||
const data = JSON.parse(res);
|
||||
this._session.accessToken = data.token;
|
||||
this._session.account = { username: data.username, displayName: data.displayName };
|
||||
this.saveSession();
|
||||
this._notify();
|
||||
return true;
|
||||
}
|
||||
this.logoutLocal();
|
||||
return false;
|
||||
} catch (e) {
|
||||
console.warn("Failed to refresh token", e);
|
||||
this.logoutLocal()
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async getSocialLists() {
|
||||
const res = await this.request<SocialList>("GET", "/getSocialLists", null);
|
||||
if (typeof res === "string") throw new Error(res);
|
||||
|
|
|
|||