Syncer should only save existing tiddlers if they have changed
This commit is contained in:
parent
cc4cb04900
commit
db9978f8c2
|
@ -257,7 +257,11 @@ Save an incoming tiddler in the store, and updates the associated tiddlerInfo
|
||||||
Syncer.prototype.storeTiddler = function(tiddlerFields) {
|
Syncer.prototype.storeTiddler = function(tiddlerFields) {
|
||||||
// Save the tiddler
|
// Save the tiddler
|
||||||
var tiddler = new $tw.Tiddler(tiddlerFields);
|
var tiddler = new $tw.Tiddler(tiddlerFields);
|
||||||
this.wiki.addTiddler(tiddler);
|
// Only save the tiddler if it has changed
|
||||||
|
var existingTiddler = this.wiki.getTiddler(tiddlerFields.title);
|
||||||
|
if(!existingTiddler || !existingTiddler.isEqual(tiddler)) {
|
||||||
|
this.wiki.addTiddler(tiddler);
|
||||||
|
}
|
||||||
// Save the tiddler revision and changeCount details
|
// Save the tiddler revision and changeCount details
|
||||||
this.tiddlerInfo[tiddlerFields.title] = {
|
this.tiddlerInfo[tiddlerFields.title] = {
|
||||||
revision: this.getTiddlerRevision(tiddlerFields.title),
|
revision: this.getTiddlerRevision(tiddlerFields.title),
|
||||||
|
|
Loading…
Reference in New Issue