mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-02 12:19:11 +00:00
Clear the tiddler event queue on startup
To avoid an unnecessary refresh cycle
This commit is contained in:
parent
a6f7da6c1c
commit
fcb26419a6
@ -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
|
||||
|
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user