Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Don't write pref on initial load, per review
Browse files Browse the repository at this point in the history
  • Loading branch information
humphd committed May 5, 2015
1 parent 83eb276 commit 8b4c7b2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/extensions/default/QuickView/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 8b4c7b2

Please sign in to comment.