From 6c8908cb8754bbb633a8de50e49309bf991b49b8 Mon Sep 17 00:00:00 2001 From: Sam Stenvall Date: Thu, 7 Aug 2014 10:13:48 +0300 Subject: [PATCH] [webui] always reload the EPG store when the tab is activated If we update the store when the tab is not activated the grid will be empty once the tab is activated again. This fixes that plus fixes the issue where the EPG data can be outdated if the web interface has been left open for a long time and the active tab has been something other than the EPG tab. --- src/webui/static/app/epg.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/webui/static/app/epg.js b/src/webui/static/app/epg.js index 81fee58a..c13c573a 100644 --- a/src/webui/static/app/epg.js +++ b/src/webui/static/app/epg.js @@ -296,14 +296,6 @@ tvheadend.epg = function() { }]) }); - /** - * Listener for DVR notifications. We want to update the EPG grid when a - * recording is finished/deleted etc. so the status icon gets updated. - */ - tvheadend.comet.on('dvrdb', function() { - epgStore.reload(); - }); - function setMetaAttr(meta, record) { var now = new Date; var start = record.get('start'); @@ -665,6 +657,11 @@ tvheadend.epg = function() { }); panel.on('rowclick', rowclicked); + + // Always reload the store when the tab is activated + panel.on('beforeshow', function() { + this.store.reload(); + }); function rowclicked(grid, index) { new tvheadend.epgDetails(grid.getStore().getAt(index).data);