From 950b1c2355107a79f190cbee513af31082121b9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 1 Oct 2015 14:19:00 +0200 Subject: [PATCH] Only show divider between core & custom commands if there are core commands --- src/octoprint/static/js/app/viewmodels/system.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/octoprint/static/js/app/viewmodels/system.js b/src/octoprint/static/js/app/viewmodels/system.js index fd2307e0..054ceff6 100644 --- a/src/octoprint/static/js/app/viewmodels/system.js +++ b/src/octoprint/static/js/app/viewmodels/system.js @@ -26,12 +26,14 @@ $(function() { self.fromCommandResponse = function(response) { var actions = []; - _.each(response.core, function(data) { - var action = _.extend({}, data); - action.actionSource = "core"; - actions.push(action); - }); - actions.push({action: "divider"}); + if (response.core && response.core.length) { + _.each(response.core, function(data) { + var action = _.extend({}, data); + action.actionSource = "core"; + actions.push(action); + }); + actions.push({action: "divider"}); + } _.each(response.custom, function(data) { var action = _.extend({}, data); action.actionSource = "custom";