Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow deleteTiddler to not modify fs #6047

Merged
merged 3 commits into from
Mar 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion plugins/tiddlywiki/filesystem/filesystemadaptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,24 @@ 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 {
callback(null,null);
}
};

/*
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;
}
Expand Down