From 0c2689dd78e47b211ed4f2ec7586dea03dcc3a9a Mon Sep 17 00:00:00 2001 From: Jermolene Date: Tue, 5 Mar 2019 15:43:14 +0000 Subject: [PATCH] SaverHandler: Don't generate file if autosave disabled --- core/modules/saver-handler.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/modules/saver-handler.js b/core/modules/saver-handler.js index 1c9b519f3..44dc130ff 100644 --- a/core/modules/saver-handler.js +++ b/core/modules/saver-handler.js @@ -151,8 +151,12 @@ Save the wiki contents. Options are: SaverHandler.prototype.saveWiki = function(options) { options = options || {}; var self = this, - method = options.method || "save", - variables = options.variables || {}, + method = options.method || "save"; + // Ignore autosave if disabled + if(method === "autosave" && this.wiki.getTiddlerText(this.titleAutoSave,"yes") !== "yes") { + return false; + } + var variables = options.variables || {}, template = options.template || "$:/core/save/all", downloadType = options.downloadType || "text/plain", text = this.wiki.renderTiddler(downloadType,template,options), @@ -171,10 +175,6 @@ SaverHandler.prototype.saveWiki = function(options) { } } }; - // Ignore autosave if disabled - if(method === "autosave" && this.wiki.getTiddlerText(this.titleAutoSave,"yes") !== "yes") { - return false; - } // Call the highest priority saver that supports this method for(var t=this.savers.length-1; t>=0; t--) { var saver = this.savers[t];