Various Improvements
Meant to fix some behavures and create some improvements
This commit is contained in:
parent
88b60e95bc
commit
8543415a94
4 changed files with 8 additions and 10 deletions
|
@ -41,7 +41,7 @@
|
|||
<img id="userpfp" class="pfp">
|
||||
</td>
|
||||
<td>
|
||||
<div id="userinfo">
|
||||
<div>
|
||||
<p id="username">USERNAME</p>
|
||||
<p id="status">SATUS</p>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
function getCookie(name) {
|
||||
const value = `; ${document.cookie}`;
|
||||
const parts = value.split(`; ${name}=`);
|
||||
if (parts.length === 2) return parts.pop().split(';').shift();
|
||||
return localStorage.getItem(name);
|
||||
}
|
||||
async function login(username, password){
|
||||
const options={
|
||||
|
@ -22,7 +20,7 @@ async function login(username, password){
|
|||
return response.errors.login._errors[0].message;
|
||||
console.log("test")
|
||||
}
|
||||
document.cookie = "token="+response.token+"; expires="+new Date(Date.now()+(6.048e+8*2));
|
||||
localStorage.setItem("token",response.token);
|
||||
window.location.href = '/channels/@me';
|
||||
return response.token;
|
||||
})
|
||||
|
@ -31,7 +29,8 @@ async function login(username, password){
|
|||
};
|
||||
}
|
||||
function gettoken(){
|
||||
const temp=getCookie("token");
|
||||
let temp=getCookie("token");
|
||||
temp??=undefined;
|
||||
if(temp===undefined){
|
||||
window.location.href = '/login.html';
|
||||
}
|
||||
|
|
|
@ -122,7 +122,7 @@ class cmessage{
|
|||
}
|
||||
|
||||
}
|
||||
div.appendChild(attatch)
|
||||
messagedwrap.appendChild(attatch)
|
||||
}
|
||||
//
|
||||
}else if(this.type===7){
|
||||
|
|
|
@ -219,8 +219,7 @@ div{
|
|||
}
|
||||
|
||||
p{
|
||||
transition: background 0.1s ease-in-out;
|
||||
transition: color 0.1s ease-in-out;
|
||||
transition: background 0.1s ease-in-out,color 0.1s ease-in-out;
|
||||
width: 100%;
|
||||
}
|
||||
.username{
|
||||
|
@ -626,4 +625,4 @@ span{
|
|||
}
|
||||
.servernoti{
|
||||
position:relative;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue