Frontend fixes.
parent
d88f243ee0
commit
df873ec77a
|
@ -21,8 +21,12 @@ form.addEventListener("submit", async function (event) {
|
|||
if (matches.status === "ok") {
|
||||
sendMessage()
|
||||
} else {
|
||||
document.querySelector("#errormessage").innerHTML = 'Username and token mismatch. Try logging in again.'
|
||||
const mismatch = 'Username and token mismatch. Try logging in again.'
|
||||
printText(mismatch.bold())
|
||||
logout()
|
||||
localStorage.removeItem('username')
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
//SEND MESSAGE FETCH FUNCTION
|
||||
|
@ -87,3 +91,10 @@ loggedIn()
|
|||
|
||||
|
||||
//REVIECE USERS PRONOUNS
|
||||
|
||||
async function getPronouns() {
|
||||
const response = await fetch(`api/users/${username}/`);
|
||||
const data = await response.json();
|
||||
pronouns = data.pronouns
|
||||
return pronouns;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
// //VARIBLES
|
||||
// // //VARIBLES
|
||||
// myStorage = window.localStorage;
|
||||
// allCookies = document.cookie;
|
||||
|
||||
|
|
Loading…
Reference in New Issue