diff --git a/src/js/main.js b/src/js/main.js index b3c83e7..422fc4b 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -44,6 +44,7 @@ $(function() { }); let socket = io(roomId); + windowHandler.socket = socket; FastClick.attach(document.body); diff --git a/src/js/window.js b/src/js/window.js index 8aff85b..c165de0 100644 --- a/src/js/window.js +++ b/src/js/window.js @@ -2,6 +2,7 @@ import FileHandler from './fileHandler'; export default class WindowHandler { constructor() { + this._socket = null; this._isActive = false; this.fileHandler = new FileHandler(); @@ -24,6 +25,10 @@ export default class WindowHandler { return this; } + set socket(socket) { + this._socket = socket; + } + notifyFavicon() { this.newMessages++; this.favicon.badge(this.newMessages);