From 6025e2be37f1044de0b963504e794306b2452817 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Thu, 31 Dec 2015 08:36:13 -0800 Subject: [PATCH] Keep a cache of messages bucketed by tile. --- static/babystats.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/static/babystats.js b/static/babystats.js index edf6b3f..2c227f2 100644 --- a/static/babystats.js +++ b/static/babystats.js @@ -206,6 +206,7 @@ BabyStats.prototype.handleMessage_ = function(isEvent, message) { } else { tile.lastSeen = message.created; tile.active = true; + tile.messages.push(message); (tile.cancels || []).forEach(function(type) { tile2 = this.findTile_(type); tile2.active = false; @@ -325,6 +326,7 @@ BabyStats.prototype.buildCells_ = function() { this.cells_ = []; this.tiles_.forEach(function(tile) { tile.active = false; + tile.messages = []; var cell = document.createElement('babyStatsCell'); this.cells_.push(cell);