From 062822d45cc828928e24b394cd4122c1ff8e2455 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Wed, 11 Dec 2013 11:45:15 +0000 Subject: [PATCH] Fix file system behaviour for loading new tiddlers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don’t need to load tiddlers because they will all have been loaded during bootup, or been created through the file system adaptor. --- core/modules/syncer.js | 4 +++- plugins/tiddlywiki/filesystem/filesystemadaptor.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/modules/syncer.js b/core/modules/syncer.js index 7a1e90ace..89295e2b5 100644 --- a/core/modules/syncer.js +++ b/core/modules/syncer.js @@ -460,7 +460,9 @@ Syncer.prototype.dispatchTask = function(task,callback) { return callback(err); } // Store the tiddler - self.storeTiddler(tiddlerFields); + if(tiddlerFields) { + self.storeTiddler(tiddlerFields); + } // Invoke the callback callback(null); }); diff --git a/plugins/tiddlywiki/filesystem/filesystemadaptor.js b/plugins/tiddlywiki/filesystem/filesystemadaptor.js index 4b370c868..d4a209c0b 100644 --- a/plugins/tiddlywiki/filesystem/filesystemadaptor.js +++ b/plugins/tiddlywiki/filesystem/filesystemadaptor.js @@ -178,10 +178,12 @@ console.log("FileSystem: Saved file",fileInfo.filepath); /* Load a tiddler and invoke the callback with (err,tiddlerFields) + +We don't need to implement loading for the file system adaptor, because all the tiddler files will have been loaded during the boot process. */ FileSystemAdaptor.prototype.loadTiddler = function(title,callback) { console.log("FileSystem: Loading",title); - callback(null,{title: title, text: "Fake tiddler: " + title}); + callback(null,null); }; /*