various fixes

This commit is contained in:
MathMan05 2024-08-16 15:10:12 -05:00
parent 4299e138fa
commit 1eea6cc005
9 changed files with 15 additions and 19 deletions

View file

@ -99,7 +99,7 @@ class Channel {
const params = new URLSearchParams("");
params.set("instance", this.info.wellknown);
const encoded = params.toString();
text.textContent = `${window.location.protocol}//${window.location.host}/invite/${json.code}?${encoded}`;
text.textContent = `${location.origin}/invite/${json.code}?${encoded}`;
});
};
update();

View file

@ -131,7 +131,7 @@ class Localuser {
"compress": !!DecompressionStream,
"presence": {
"status": "online",
"since": new Date().getTime(),
"since": null, //new Date().getTime()
"activities": [],
"afk": false
}
@ -1092,7 +1092,7 @@ class Localuser {
guild_id: guildid,
limit: 100,
nonce,
//presences:true
presences: true
}
}));
this.fetchingmembers.set(guildid, true);

View file

@ -200,8 +200,8 @@ async function login(username, password, captcha) {
};
try {
const info = JSON.parse(localStorage.getItem("instanceinfo"));
const api = info.login;
return await fetch(api + '/auth/login', options).then(response => response.json())
const api = info.login + (info.login.startsWith("/") ? "/" : "");
return await fetch(api + 'auth/login', options).then(response => response.json())
.then((response) => {
console.log(response, response.message);
if ("Invalid Form Body" === response.message) {