From d8572f774091266885658177d725c72c7a68283c Mon Sep 17 00:00:00 2001 From: Sam Stenvall Date: Wed, 13 Aug 2014 10:36:30 +0300 Subject: [PATCH] [webui] fix status icon updates when a recording is scheduled/started from the EPG grid We can listen on dvrdb comet updates but we should only act on them when the EPG grid is visible. When it's not visible the update is delayed until the tab becomes visible again. --- src/webui/static/app/epg.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/webui/static/app/epg.js b/src/webui/static/app/epg.js index c13c573a..5ada870d 100644 --- a/src/webui/static/app/epg.js +++ b/src/webui/static/app/epg.js @@ -658,6 +658,17 @@ tvheadend.epg = function() { panel.on('rowclick', rowclicked); + /** + * Listener for DVR notifications. We want to update the EPG grid when a + * recording is finished/deleted etc. so the status icon gets updated. + * Only do this when the tab is visible, otherwise it won't work as + * expected. + */ + tvheadend.comet.on('dvrdb', function() { + if (panel.isVisible()) + epgStore.reload(); + }); + // Always reload the store when the tab is activated panel.on('beforeshow', function() { this.store.reload();