From 23e2fb8496efead6547a0727d4028447878d876e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 10 Feb 2009 11:56:20 +0300 Subject: [PATCH] fixes for browser lacking Gears --- offline.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/offline.js b/offline.js index 543930d2..2fc82094 100644 --- a/offline.js +++ b/offline.js @@ -750,8 +750,7 @@ function update_offline_data(stage) { try { if (!stage) stage = 0; - if (offline_mode) return; - if (getInitParam("offline_enabled") != "1") return; + if (!db || offline_mode || getInitParam("offline_enabled") != "1") return; debug("update_offline_data: stage " + stage); @@ -939,7 +938,7 @@ function get_local_feed_unread(id) { function enable_offline_reading() { try { - if (getInitParam("offline_enabled") == "1") { + if (db && getInitParam("offline_enabled") == "1") { init_local_sync_data(); Element.show("restartOfflinePic"); window.setTimeout("update_offline_data(0)", 100); @@ -1293,6 +1292,9 @@ function format_article_labels(labels, id) { function init_local_sync_data() { try { + + if (!db) return; + var rs = db.execute("SELECT COUNT(*) FROM syncdata WHERE key = 'last_online'"); var has_last_online = 0; -- 2.39.5