Skip to content

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 3a09a13
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Submodule acorn updated from 443501 to 78e1d7
2 changes: 1 addition & 1 deletion src/extensions/default/JavaScriptCodeHints/thirdparty/tern
Submodule tern updated from ed952d to 7606a6
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 3a09a13

Please sign in to comment.