From b8fcc9f0c076dd10c5ff844ed7176c3914704779 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Mon, 19 Nov 2012 13:59:32 +0000 Subject: [PATCH] Fixed problem with polling --- plugins/tiddlywiki/tiddlyweb/tiddlyweb.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/plugins/tiddlywiki/tiddlyweb/tiddlyweb.js b/plugins/tiddlywiki/tiddlyweb/tiddlyweb.js index 3a6649ea7..379aad904 100644 --- a/plugins/tiddlywiki/tiddlyweb/tiddlyweb.js +++ b/plugins/tiddlywiki/tiddlyweb/tiddlyweb.js @@ -61,12 +61,8 @@ TiddlyWebSyncer.prototype.addConnection = function(connection) { // Get the login status this.getStatus(function (err,isLoggedIn,json) { if(isLoggedIn) { - // Do a sync now + // Do a sync self.syncFromServer(); - // And every so often - window.setInterval(function() { - self.syncFromServer.call(self); - },TiddlyWebSyncer.pollTimerInterval) } }); return ""; // We only support a single connection @@ -269,22 +265,28 @@ console.log("error in syncFromServer",err); return; } // Store the skinny versions of these tiddlers - var json = JSON.parse(data); + var json = JSON.parse(data), + wasAnyTiddlerStored = false; for(var t=0; t