diff --git a/web/src/app/js/pages/meet.js b/web/src/app/js/pages/meet.js index 41bdf2a..526abb5 100644 --- a/web/src/app/js/pages/meet.js +++ b/web/src/app/js/pages/meet.js @@ -1,5 +1,6 @@ app.pages.meet = { data: [], + isActive: function() { return (window.location.hash+'/').startsWith('#meet/') }, load: function(args) { document.querySelector('#page-meet').removeAttribute('style'); const dom = document.querySelector('#page-meet #content'); @@ -10,6 +11,7 @@ app.pages.meet = { app.pages.meet.data = json; app.template.loadMany(['meet.item','meet.actions'], function(_) { app.pages.meet.paint(json); + app.pages.meet.paintInterval(); }); }); }, @@ -21,6 +23,15 @@ app.pages.meet = { app.pages.meet.paint(); }); }, + _paintInterval: false, + paintInterval: function() { + if (app.pages.meet.data._paintInterval) return; + app.pages.meet.data._paintInterval = true; + setInterval(function() { + if (app.pages.meet.isActive()) + app.pages.meet.paint(); + }, 1000 * 30); + }, paint: function(json) { json = json || app.pages.meet.data; let _;