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:
parent
5e0308b53b
commit
93aa9002da
@ -38,9 +38,7 @@ class Channel {
|
||||
subscribe() {
|
||||
this.channel.on("game:update", this.updateGame.bind(this));
|
||||
|
||||
this.presence.onSync(() => {
|
||||
this.setOpponentStatus();
|
||||
})
|
||||
this.presence.onSync(() => { this.setOpponentStatus(); });
|
||||
}
|
||||
|
||||
updateGame(data) {
|
||||
|
||||
@ -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;
|
||||
Loading…
Reference in New Issue
Block a user