From 7dabf832b65524bf9023bcb64fd27ef6806152f0 Mon Sep 17 00:00:00 2001 From: Niko Date: Thu, 17 Feb 2022 01:32:54 +0100 Subject: [PATCH] Added a repaint interval function for pages.meet (if active) --- web/src/app/js/pages/meet.js | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 _;