Skip to content

Commit

Permalink
Ensure isLib param is never undefined
Browse files Browse the repository at this point in the history
* Fixes a hidden boog underneath an existing .user.js with the incorrect placeholder

Applies to OpenUserJS#1232
  • Loading branch information
Martii committed Dec 3, 2017
1 parent 60fb9b4 commit da57f37
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions controllers/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ var removeReasons = require('../views/includes/scriptModals.json').removeReasons
exports.new = function (aController) {
return (function (aReq, aRes, aNext) {
aReq.params.isNew = true;
aReq.params.isLib = false; // NOTE: Set default .user.js and overridden below
aController(aReq, aRes, aNext);
});
};
Expand Down
2 changes: 1 addition & 1 deletion views/includes/scripts/scriptEditor.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
var hasChanged = false;
var placeholder = null;
var username = '{{authedUser.name}}' || 'username';
var isLib = !!'{{isLib}}';
var isLib = {{isLib}};
var now = new Date();
var year = now.getFullYear();

Expand Down

0 comments on commit da57f37

Please sign in to comment.