1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 02:19:55 +00:00

Fix problem with lazy loading under Node.js

Fixes #2514
This commit is contained in:
Jermolene 2016-08-16 15:48:14 +01:00
parent 118b2ffe2f
commit 18dd8d4433

View File

@ -135,7 +135,7 @@ Syncer.prototype.updateDirtyStatus = function() {
/*
Save an incoming tiddler in the store, and updates the associated tiddlerInfo
*/
Syncer.prototype.storeTiddler = function(tiddlerFields) {
Syncer.prototype.storeTiddler = function(tiddlerFields,hasBeenLazyLoaded) {
// Save the tiddler
var tiddler = new $tw.Tiddler(this.wiki.getTiddler(tiddlerFields.title),tiddlerFields);
this.wiki.addTiddler(tiddler);
@ -144,7 +144,7 @@ Syncer.prototype.storeTiddler = function(tiddlerFields) {
revision: tiddlerFields.revision,
adaptorInfo: this.syncadaptor.getTiddlerInfo(tiddler),
changeCount: this.wiki.getChangeCount(tiddlerFields.title),
hasBeenLazyLoaded: true
hasBeenLazyLoaded: hasBeenLazyLoaded !== undefined ? hasBeenLazyLoaded : true
};
};
@ -218,7 +218,7 @@ Syncer.prototype.syncFromServer = function() {
});
} else {
// Load the skinny version of the tiddler
self.storeTiddler(tiddlerFields);
self.storeTiddler(tiddlerFields,false);
}
}
}
@ -499,7 +499,7 @@ Syncer.prototype.dispatchTask = function(task,callback) {
}
// Store the tiddler
if(tiddlerFields) {
self.storeTiddler(tiddlerFields);
self.storeTiddler(tiddlerFields,true);
}
// Invoke the callback
callback(null);