mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 03:57:21 +00:00
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) {
|
||||
// Save the tiddler
|
||||
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
|
||||
this.tiddlerInfo[tiddlerFields.title] = {
|
||||
revision: this.getTiddlerRevision(tiddlerFields.title),
|
||||
|
Loading…
Reference in New Issue
Block a user