diff --git a/modules/brand.js b/modules/brand.js index 863e9e37990caa9e61f81ca562a4a22b518ce17f..9471cb0b090d6c06ab39d781825e6103f806f519 100644 --- a/modules/brand.js +++ b/modules/brand.js @@ -2,7 +2,7 @@ var httpreq = require('httpreq'); var Mustache = require('mustache'); var URL = 'https://status.stratum0.org/status.json'; -var TEMPLATES = ''; +var TEMPLATES = {}; require('fs').readFile('modules/brand/template.mustache', 'utf-8', function (err, data) { TEMPLATES.template = data; }); @@ -40,7 +40,7 @@ module.exports = function (io) { state.since = DOW[d.getDay()]+', '+pad(d.getHours(),2)+':' +pad(d.getMinutes(),2); status = state; - renderStatus(); + renderStatus(io); } if (firstTime && status) { io.on('connection', function (sock) { diff --git a/modules/calendar.js b/modules/calendar.js index 6dbdfca505bec99a46ccd6ad5f3fb916d3b43fc5..fd985ca79da3801b38b2dcacfba8d294517ceee7 100644 --- a/modules/calendar.js +++ b/modules/calendar.js @@ -113,7 +113,7 @@ module.exports = function (io) { update(function () { var pushToClients = function (sock) { sock.emit('calendar', Mustache.render(TEMPLATE, CALENDAR)); - }); + }; io.on('connect', pushToClients); pushToClients(io); });