From 8b4c7b2949999a98ab5eb46eaf6b7078d561ecea Mon Sep 17 00:00:00 2001 From: "David Humphrey (:humph) david.humphrey@senecacollege.ca" Date: Mon, 4 May 2015 21:32:37 -0400 Subject: [PATCH] Don't write pref on initial load, per review --- src/extensions/default/QuickView/main.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/extensions/default/QuickView/main.js b/src/extensions/default/QuickView/main.js index 01c252c7513..912399bfe11 100644 --- a/src/extensions/default/QuickView/main.js +++ b/src/extensions/default/QuickView/main.js @@ -739,11 +739,13 @@ define(function (require, exports, module) { CommandManager.get(CMD_ENABLE_QUICK_VIEW).setChecked(enabled); } - function setExtensionlessImagePreview(_extensionlessImagePreview) { + function setExtensionlessImagePreview(_extensionlessImagePreview, doNotSave) { if(extensionlessImagePreview !== _extensionlessImagePreview) { extensionlessImagePreview = _extensionlessImagePreview; - prefs.set("extensionlessImagePreview", enabled); - prefs.save(); + if (!doNotSave) { + prefs.set("extensionlessImagePreview", enabled); + prefs.save(); + } } } @@ -814,7 +816,7 @@ define(function (require, exports, module) { // Setup initial UI state setEnabled(prefs.get("enabled"), true); - setExtensionlessImagePreview(prefs.get("extensionlessImagePreview")); + setExtensionlessImagePreview(prefs.get("extensionlessImagePreview"), true); prefs.on("change", "enabled", function () { setEnabled(prefs.get("enabled"), true);