Add blahs in actions
All checks were successful
Android Build / publish (push) Successful in 44s
Linux Build / publish (push) Successful in 53s

This commit is contained in:
olcxja 2026-05-21 08:28:06 +02:00
commit 81145968a1
9 changed files with 237 additions and 35 deletions

View file

@ -325,7 +325,7 @@ async function Auth(username, password) {
}
async function fetchEncrypted(request, body) {
async function fetchEncrypted(request, body = "") {
let nonce = await getNonce(username, passwordHash);
@ -420,7 +420,7 @@ function showAction(message, actionid) {
const notif = document.createElement('div');
notif.className = `notification action`;
notif.textContent = message;
notif.textContent = processBlah(message);
notif.id = `notification-${actionid}`;
container.appendChild(notif);
@ -964,16 +964,60 @@ function setActiveRoombarItem(itemId) {
}
}
function switchInvitesTab(tab) {
async function switchInvitesTab(tab) {
if (!document.getElementById(`tab-invites-${tab}`).classList.contains('tab-inactive')) return;
document.getElementById('tab-invites-received').classList.add('tab-inactive');
document.getElementById('tab-invites-sent').classList.add('tab-inactive');
document.getElementById(`tab-invites-${tab}`).classList.remove('tab-inactive');
let container = document.getElementById("invites-container");
let innerString = "";
if (tab == "received")
if (tab === "received")
{
try {
showAction("action.fetching.invites.recv", "fetching.invites.recv");
let res = await fetchEncrypted("user/invites/received");
if (res !== "")
{
if (res.includes(",")) {
console.log(res);
}
else
{
console.log(res);
container.innerHTML = invitesEntry;
}
}
}
catch (e) {
showBlahNotification("error:something.wrong");
console.error(e);
}
clearAction("fetching.invites.recv");
}
else if (tab === "sent")
{
try {
showAction("action.fetching.invites.sent", "fetching.invites.sent");
let res = await fetchEncrypted("user/invites/sent");
if (res !== "")
{
if (res.includes(",")) {
console.log(res);
}
else
{
console.log(res);
container.innerHTML = invitesEntry;
}
}
}
catch (e) {
showBlahNotification("error:something.wrong");
console.error(e);
}
clearAction("fetching.invites.sent");
}
}