Remove useless code
This commit is contained in:
parent
3dfd3b0729
commit
82bf8c5aa4
@ -7,38 +7,16 @@ export default class extends AbstractView {
|
||||
super(params, 'SearchWindowTitle');
|
||||
}
|
||||
|
||||
async wait_get_online_users() {
|
||||
return new Promise((resolve) => {
|
||||
const checkInterval = setInterval(() => {
|
||||
console.log(client.notice.data.online);
|
||||
if (Object.keys(client.notice.data.online).length > 0) {
|
||||
clearInterval(checkInterval);
|
||||
resolve();
|
||||
}
|
||||
}, 1);
|
||||
});
|
||||
}
|
||||
|
||||
async postInit() {
|
||||
|
||||
let logged = await client.isAuthenticated();
|
||||
let profiles = await client.profiles.all();
|
||||
|
||||
//console.log(client.notice.data);
|
||||
//if (client.notice.data == undefined || client.notice.data.online == undefined)
|
||||
//return console.log("Error");
|
||||
|
||||
//await client.notice.getOnlineUser();
|
||||
//await this.wait_get_online_users();
|
||||
//client.notice.rewrite_usernames = this.rewrite_usernames;
|
||||
//client.notice.rewrite_invite = this.display_invite;
|
||||
|
||||
let search = document.getElementById("input_user");
|
||||
if (search != undefined)
|
||||
search.oninput = () => this.display_users(logged, profiles);
|
||||
|
||||
let chat_input = document.getElementById("input_chat");
|
||||
//chat_input.addEventListener("keydown", this.display_chat_manager)
|
||||
|
||||
this.last_add_chat = undefined;
|
||||
|
||||
@ -132,31 +110,6 @@ export default class extends AbstractView {
|
||||
|
||||
list_users.appendChild(new_user);
|
||||
});
|
||||
//console.log(list_users);
|
||||
|
||||
}
|
||||
|
||||
async rewrite_usernames() {
|
||||
let search_document = document.getElementById("input_user");
|
||||
|
||||
if (search_document == undefined || search_document == null)
|
||||
return;
|
||||
|
||||
let search = search_document.value.toLowerCase();
|
||||
|
||||
let profiles = await client.profiles.all();
|
||||
|
||||
profiles.filter(user => user.username.toLowerCase().startsWith(search) == true).forEach((user) => {
|
||||
let username = document.getElementById(`username${user.id}`);
|
||||
if (username !== null) {
|
||||
if (user.id == client.me.id)
|
||||
username.style.color = "green";
|
||||
else {
|
||||
let online = client.notice.data.online[user.id];
|
||||
username.style.color = online !== undefined ? online : "gray";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user