fixes for browser lacking Gears

This commit is contained in:
Andrew Dolgov 2009-02-10 11:56:20 +03:00
parent a206a56c6d
commit 23e2fb8496
1 changed files with 5 additions and 3 deletions

View File

@ -750,8 +750,7 @@ function update_offline_data(stage) {
try { try {
if (!stage) stage = 0; if (!stage) stage = 0;
if (offline_mode) return; if (!db || offline_mode || getInitParam("offline_enabled") != "1") return;
if (getInitParam("offline_enabled") != "1") return;
debug("update_offline_data: stage " + stage); debug("update_offline_data: stage " + stage);
@ -939,7 +938,7 @@ function get_local_feed_unread(id) {
function enable_offline_reading() { function enable_offline_reading() {
try { try {
if (getInitParam("offline_enabled") == "1") { if (db && getInitParam("offline_enabled") == "1") {
init_local_sync_data(); init_local_sync_data();
Element.show("restartOfflinePic"); Element.show("restartOfflinePic");
window.setTimeout("update_offline_data(0)", 100); window.setTimeout("update_offline_data(0)", 100);
@ -1293,6 +1292,9 @@ function format_article_labels(labels, id) {
function init_local_sync_data() { function init_local_sync_data() {
try { try {
if (!db) return;
var rs = db.execute("SELECT COUNT(*) FROM syncdata WHERE key = 'last_online'"); var rs = db.execute("SELECT COUNT(*) FROM syncdata WHERE key = 'last_online'");
var has_last_online = 0; var has_last_online = 0;