Passing socket to window handler

This commit is contained in:
Dan Seripap 2016-02-19 12:52:07 -05:00
parent c6670b56d6
commit 0762bbd15c
2 changed files with 6 additions and 0 deletions

View File

@ -44,6 +44,7 @@ $(function() {
}); });
let socket = io(roomId); let socket = io(roomId);
windowHandler.socket = socket;
FastClick.attach(document.body); FastClick.attach(document.body);

View File

@ -2,6 +2,7 @@ import FileHandler from './fileHandler';
export default class WindowHandler { export default class WindowHandler {
constructor() { constructor() {
this._socket = null;
this._isActive = false; this._isActive = false;
this.fileHandler = new FileHandler(); this.fileHandler = new FileHandler();
@ -24,6 +25,10 @@ export default class WindowHandler {
return this; return this;
} }
set socket(socket) {
this._socket = socket;
}
notifyFavicon() { notifyFavicon() {
this.newMessages++; this.newMessages++;
this.favicon.badge(this.newMessages); this.favicon.badge(this.newMessages);