From: Andrew Dolgov Date: Wed, 4 Feb 2009 20:17:50 +0000 (+0300) Subject: do not allow offline browsing when DB is empty X-Git-Tag: 1.3.1~85 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=b15e516ec41c754a9b134e4eb5b4092f19a863ae;p=tt-rss.git do not allow offline browsing when DB is empty --- diff --git a/offline.js b/offline.js index 6d0b05a1..0050a58b 100644 --- a/offline.js +++ b/offline.js @@ -496,9 +496,26 @@ function init_offline() { rs.close(); + var rs = db.execute("SELECT COUNT(*) FROM feeds"); + + var num_feeds = 0; + + if (rs.isValidRow()) { + num_feeds = rs.field(0); + } + + rs.close(); + + if (num_feeds == 0) { + remove_splash(); + return fatalError(0, + __("Data for offline browsing has not been downloaded yet.")); + } + render_offline_feedlist(); init_second_stage(); - remove_splash(); + window.setTimeout("viewfeed(-4)", 50); + } catch (e) { exception_error("init_offline", e); }