fix search

This commit is contained in:
AdrienLSH 2024-05-14 09:43:35 +02:00
parent e308e8f012
commit da789b3306
2 changed files with 5 additions and 10 deletions

View File

@ -64,7 +64,7 @@
font-size: 0.75em;
}
#app #input_user{
#app #username-input{
color: green;
width: 8.5em;
height: 1.1em;

View File

@ -15,11 +15,7 @@ export default class extends AbstractView {
this.logged = await client.isAuthenticated();
this.profiles = await client.profiles.all();
document.getElementById('username-input').oninput = () => this.display_users(this.logged, this.profiles);
let search = document.getElementById("input_user");
if (search != undefined)
search.oninput = () => this.display_users();
document.getElementById("username-input").oninput = () => this.display_users();
this.last_add_chat = undefined;
@ -41,18 +37,17 @@ export default class extends AbstractView {
return;
}
var new_user = document.createElement("li");
const new_user = document.createElement("li");
// username
let username = document.createElement("a");
const username = document.createElement("a");
username.setAttribute('data-link', '');
username.id = `username${user.id}`;
username.href = `/profiles/${user.username}`;
if (this.logged && user.id == client.me.id)
username.style.color = "green";
else {
let profile = await client.profiles.getProfileId(user.id);
let online = profile.online;
const online = user.online;
if (online == undefined)
username.style.color = "gray";
else if (online == true)