fixes again

This commit is contained in:
Jonas Weinz 2019-03-24 18:55:06 +01:00
parent 80b8ff8f93
commit 3a22acf510

View File

@ -294,18 +294,26 @@ class WebsocketConnection
{
var tmp = this.search_container.create_double_button("" + this.friends[i], "-");
tmp[1].addEventListener("click", () => {
this.send_match_request("" +this.friends[i]);
tmp[1].name = this.friends[i];
tmp[2].name = this.friends[i];
tmp[1].connection = this;
tmp[2].connection = this;
tmp[1].addEventListener("click", function() {
this.connection.send_match_request(this.name);
});
tmp[2].addEventListener("click", () => {
this.send_unfriend_request("" +this.friends[i]);
tmp[2].addEventListener("click", function (){
this.connection.send_unfriend_request(this.name);
});
this.friend_name_divs.push(tmp[0])
}
}
connect(username, pw)
{
this.socket = new WebSocket(server_protocol + this.ip + ":" + this.port);