mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-08 23:20:03 +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());
|
$tw.wiki.addTiddler({title: storyTitle, text: "", list: story},$tw.wiki.getModificationFields());
|
||||||
};
|
};
|
||||||
displayDefaultTiddlers();
|
displayDefaultTiddlers();
|
||||||
|
// Clear outstanding tiddler store change events to avoid an unnecessary refresh cycle at startup
|
||||||
|
$tw.wiki.clearTiddlerEventQueue();
|
||||||
// Set up the syncer object
|
// Set up the syncer object
|
||||||
$tw.syncer = new $tw.Syncer({wiki: $tw.wiki});
|
$tw.syncer = new $tw.Syncer({wiki: $tw.wiki});
|
||||||
// Host-specific startup
|
// 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) {
|
exports.getChangeCount = function(title) {
|
||||||
this.changeCount = this.changeCount || Object.create(null);
|
this.changeCount = this.changeCount || Object.create(null);
|
||||||
if($tw.utils.hop(this.changeCount,title)) {
|
if($tw.utils.hop(this.changeCount,title)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user