forked from olcxjas-softworks/LarpixClient
Add blahs in actions
This commit is contained in:
parent
5a9875ea01
commit
81145968a1
9 changed files with 237 additions and 35 deletions
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue