Skip to content
Snippets Groups Projects
Commit ed4fa5a8 authored by Kasalehlia's avatar Kasalehlia
Browse files

fixes

parent 8219e8e4
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
......@@ -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);
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment