From ed4fa5a8b12f4c0e9538aa01d9dd94b2e1762c7d Mon Sep 17 00:00:00 2001 From: Kasalehlia <kasalehlia@clonejo.de> Date: Tue, 17 Nov 2015 20:37:02 +0100 Subject: [PATCH] fixes --- modules/brand.js | 4 ++-- modules/calendar.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/brand.js b/modules/brand.js index 863e9e3..9471cb0 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 6dbdfca..fd985ca 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); }); -- GitLab