From d3ce4e9e8a8050db86e5af995be876aa710189cc Mon Sep 17 00:00:00 2001 From: Marti Martz Date: Sun, 3 Dec 2017 13:10:34 -0700 Subject: [PATCH] Ensure `isLib` param is never `undefined` (#1300) * Fixes a hidden boog underneath an existing .user.js with the incorrect placeholder Applies to #1232 Auto-merge --- controllers/script.js | 1 + views/includes/scripts/scriptEditor.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/controllers/script.js b/controllers/script.js index 51f202ec8..e76bbbf6f 100644 --- a/controllers/script.js +++ b/controllers/script.js @@ -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); }); }; diff --git a/views/includes/scripts/scriptEditor.html b/views/includes/scripts/scriptEditor.html index 8b3b3dd8e..c29452ac5 100644 --- a/views/includes/scripts/scriptEditor.html +++ b/views/includes/scripts/scriptEditor.html @@ -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();