1
0
mirror of https://github.com/danbee/chess synced 2025-03-04 08:39:06 +00:00

This file is no longer relevant

This commit is contained in:
Daniel Barber 2018-11-09 13:48:00 -05:00
parent 5e0308b53b
commit 93aa9002da
Signed by: danbarber
GPG Key ID: 931D8112E0103DD8
2 changed files with 1 additions and 27 deletions

View File

@ -38,9 +38,7 @@ class Channel {
subscribe() { subscribe() {
this.channel.on("game:update", this.updateGame.bind(this)); this.channel.on("game:update", this.updateGame.bind(this));
this.presence.onSync(() => { this.presence.onSync(() => { this.setOpponentStatus(); });
this.setOpponentStatus();
})
} }
updateGame(data) { updateGame(data) {

View File

@ -1,24 +0,0 @@
import _ from "lodash";
import { Presence } from "phoenix";
class Presences {
constructor() {
this.presences = {};
}
syncState(data) {
this.presences = Presence.syncState(this.presences, data);
}
syncDiff(data) {
this.presences = Presence.syncDiff(this.presences, data);
}
opponentOnline(opponentId) {
return _.find(this.presences, (value, id) => {
return parseInt(id) == opponentId;
});
}
}
export default Presences;