Bug fixes
This commit is contained in:
parent
83802ef6a2
commit
0710685e50
6 changed files with 26 additions and 4 deletions
|
@ -189,7 +189,9 @@ class Channel {
|
|||
}.bind(this), async function (id) {
|
||||
const message = SnowFlake.getSnowFlakeFromID(id, Message).getObject();
|
||||
try {
|
||||
message.deleteDiv();
|
||||
if (message) {
|
||||
message.deleteDiv();
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
console.error(e);
|
||||
|
|
|
@ -85,6 +85,7 @@ function showAccountSwitcher() {
|
|||
}
|
||||
let thisuser;
|
||||
try {
|
||||
console.log(users.users, users.currentuser);
|
||||
thisuser = new Localuser(users.users[users.currentuser]);
|
||||
thisuser.initwebsocket().then(_ => {
|
||||
thisuser.loaduser();
|
||||
|
@ -94,7 +95,8 @@ try {
|
|||
console.log("done loading");
|
||||
});
|
||||
}
|
||||
catch {
|
||||
catch (e) {
|
||||
console.error(e);
|
||||
document.getElementById("load-desc").textContent = "Account unable to start";
|
||||
thisuser = new Localuser(-1);
|
||||
}
|
||||
|
|
|
@ -42,6 +42,13 @@ function trimswitcher() {
|
|||
map.set(wellknown, [thing, user]);
|
||||
}
|
||||
}
|
||||
for (const thing in json.users) {
|
||||
if (thing[thing.length - 1] === "/") {
|
||||
const user = json.users[thing];
|
||||
delete json.users[thing];
|
||||
json.users[thing.slice(0, -1)] = user;
|
||||
}
|
||||
}
|
||||
localStorage.setItem("userinfos", JSON.stringify(json));
|
||||
console.log(json);
|
||||
}
|
||||
|
|
|
@ -202,7 +202,9 @@ class Channel{
|
|||
async function(this:Channel,id:string){
|
||||
const message=SnowFlake.getSnowFlakeFromID(id,Message).getObject();
|
||||
try{
|
||||
message.deleteDiv();
|
||||
if(message){
|
||||
message.deleteDiv();
|
||||
}
|
||||
}catch(e){console.error(e)}finally{}
|
||||
}.bind(this),
|
||||
this.readbottom.bind(this)
|
||||
|
|
|
@ -95,6 +95,7 @@ function showAccountSwitcher(){
|
|||
}
|
||||
let thisuser:Localuser;
|
||||
try{
|
||||
console.log(users.users,users.currentuser)
|
||||
thisuser=new Localuser(users.users[users.currentuser]);
|
||||
thisuser.initwebsocket().then(_=>{
|
||||
thisuser.loaduser();
|
||||
|
@ -103,7 +104,8 @@ try{
|
|||
document.getElementById("loading").classList.remove("loading");
|
||||
console.log("done loading")
|
||||
});
|
||||
}catch{
|
||||
}catch(e){
|
||||
console.error(e);
|
||||
document.getElementById("load-desc").textContent="Account unable to start";
|
||||
thisuser=new Localuser(-1);
|
||||
}
|
||||
|
|
|
@ -41,6 +41,13 @@ function trimswitcher(){
|
|||
map.set(wellknown,[thing,user]);
|
||||
}
|
||||
}
|
||||
for(const thing in json.users){
|
||||
if(thing[thing.length-1]==="/"){
|
||||
const user=json.users[thing];
|
||||
delete json.users[thing];
|
||||
json.users[thing.slice(0, -1)]=user;
|
||||
}
|
||||
}
|
||||
localStorage.setItem("userinfos",JSON.stringify(json));
|
||||
console.log(json);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue