Use this.wiki where applicable (#4601)

* Use state.wiki

* use local wiki where available

* fix a couple this vs self cases
This commit is contained in:
Arlen22
2020-05-06 11:27:50 +01:00
committed by GitHub
parent 48dfadd85b
commit 81f07cdf85
13 changed files with 25 additions and 22 deletions
+3 -3
View File
@@ -127,7 +127,7 @@ function Syncer(options) {
});
}
// Listen out for lazyLoad events
if(!this.disableUI && $tw.wiki.getTiddlerText(this.titleSyncDisableLazyLoading) !== "yes") {
if(!this.disableUI && this.wiki.getTiddlerText(this.titleSyncDisableLazyLoading) !== "yes") {
this.wiki.addEventListener("lazyLoad",function(title) {
self.handleLazyLoadEvent(title);
});
@@ -204,7 +204,7 @@ Syncer.prototype.isDirty = function() {
if(this.wiki.tiddlerExists(title)) {
if(tiddlerInfo) {
// If the tiddler is known on the server and has been modified locally then it needs to be saved to the server
if($tw.wiki.getChangeCount(title) > tiddlerInfo.changeCount) {
if(this.wiki.getChangeCount(title) > tiddlerInfo.changeCount) {
return true;
}
} else {
@@ -526,7 +526,7 @@ Syncer.prototype.chooseNextTask = function() {
tiddlerInfo = this.tiddlerInfo[title];
if(tiddler) {
// If the tiddler is not known on the server, or has been modified locally no more recently than the threshold then it needs to be saved to the server
var hasChanged = !tiddlerInfo || $tw.wiki.getChangeCount(title) > tiddlerInfo.changeCount,
var hasChanged = !tiddlerInfo || this.wiki.getChangeCount(title) > tiddlerInfo.changeCount,
isReadyToSave = !tiddlerInfo || !tiddlerInfo.timestampLastSaved || tiddlerInfo.timestampLastSaved < thresholdLastSaved;
if(hasChanged) {
if(isReadyToSave) {