diff --git a/plugins/tiddlywiki/filesystem/filesystemadaptor.js b/plugins/tiddlywiki/filesystem/filesystemadaptor.js index 0ed686c8495..0692fb2fef0 100644 --- a/plugins/tiddlywiki/filesystem/filesystemadaptor.js +++ b/plugins/tiddlywiki/filesystem/filesystemadaptor.js @@ -140,7 +140,7 @@ FileSystemAdaptor.prototype.deleteTiddler = function(title,callback,options) { } } // Remove the tiddler from self.boot.files & return null adaptorInfo - delete self.boot.files[title]; + self.deleteTiddlerInCache(title); return callback(null,null); }); } else { @@ -148,6 +148,16 @@ FileSystemAdaptor.prototype.deleteTiddler = function(title,callback,options) { } }; +/* +Delete a tiddler in cache, without modifying file system. +*/ +FileSystemAdaptor.prototype.deleteTiddlerInCache = function(title) { + // Only delete the tiddler if we have writable information for the file + if(this.boot.files[title]) { + delete this.boot.files[title]; + }; +}; + if(fs) { exports.adaptorClass = FileSystemAdaptor; }