1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-18 11:29:55 +00:00

Clear the tiddler event queue on startup

To avoid an unnecessary refresh cycle
This commit is contained in:
Jermolene 2014-04-30 22:49:02 +01:00
parent a6f7da6c1c
commit fcb26419a6
2 changed files with 7 additions and 0 deletions

View File

@ -82,6 +82,8 @@ exports.startup = function() {
$tw.wiki.addTiddler({title: storyTitle, text: "", list: story},$tw.wiki.getModificationFields());
};
displayDefaultTiddlers();
// Clear outstanding tiddler store change events to avoid an unnecessary refresh cycle at startup
$tw.wiki.clearTiddlerEventQueue();
// Set up the syncer object
$tw.syncer = new $tw.Syncer({wiki: $tw.wiki});
// Host-specific startup

View File

@ -148,6 +148,11 @@ exports.enqueueTiddlerEvent = function(title,isDeleted) {
}
};
exports.clearTiddlerEventQueue = function() {
this.changedTiddlers = Object.create(null);
this.changeCount = Object.create(null)
};
exports.getChangeCount = function(title) {
this.changeCount = this.changeCount || Object.create(null);
if($tw.utils.hop(this.changeCount,title)) {