When we save items to IndexDB, we need to think about clean the items or keep those in a short list. IndexController.prototype._onSocketMessage = function(data) { var messages = JSON.parse(data); this._dbPromise.then(function(db) { if (!db) return; v…
We cannot let photo always keep caching new data without clean the old data. If message is not display on the page anymore, we want to clean it. And also every 5 mins we want to clean the photo data. export default function IndexController(container)…
We want to use IDB to store the wittr messages. The logic is when the page start: service worker will read the skeleton from the cache and show to the interface. read the message data from the IDB first instead of going to network. Show the data from…