From 16036e0e9b94ceafd0b2430db0528add577dc3fc Mon Sep 17 00:00:00 2001 From: shanmukhm Date: Thu, 9 Jun 2016 18:58:11 +0530 Subject: [PATCH 1/2] MOTECH-2618 Fixed the console error while selecting default configuration --- commcare/src/main/resources/webapp/js/controllers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commcare/src/main/resources/webapp/js/controllers.js b/commcare/src/main/resources/webapp/js/controllers.js index 100dfc235..763f16f19 100644 --- a/commcare/src/main/resources/webapp/js/controllers.js +++ b/commcare/src/main/resources/webapp/js/controllers.js @@ -297,7 +297,7 @@ } else { $scope.rollback = false; } - } else if (newValue !== undefined && newValue.name === "") { + } else if (newValue && newValue.name === "") { $scope.newConfig = true; $scope.oldName = ""; $scope.clearMessages(); From 5306e2ade292fc252fc5bf0330c16f2f516c837a Mon Sep 17 00:00:00 2001 From: shanmukhm Date: Tue, 21 Jun 2016 13:09:52 +0530 Subject: [PATCH 2/2] Small changes in null checks --- commcare/src/main/resources/webapp/js/controllers.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commcare/src/main/resources/webapp/js/controllers.js b/commcare/src/main/resources/webapp/js/controllers.js index 763f16f19..6381e398b 100644 --- a/commcare/src/main/resources/webapp/js/controllers.js +++ b/commcare/src/main/resources/webapp/js/controllers.js @@ -280,14 +280,14 @@ $scope.$parent.configurations.configs.splice($scope.$parent.configurations.configs.indexOf(oldValue), 1); $scope.$parent.$apply(); $scope.configOutdated = false; - if (newValue === undefined || newValue.name !== "") { + if (!newValue || newValue.name) { $scope.newConfig = false; } $scope.clearMessages(); } else if ($scope.configOutdated) { $scope.$parent.configurations.configs[$scope.$parent.configurations.configs.indexOf(oldValue)] = $scope.selectedConfigBackup; $scope.configOutdated = false; - if (newValue.name === "") { + if (!newValue.name) { $scope.newConfig = true; } $scope.clearMessages(); @@ -297,7 +297,7 @@ } else { $scope.rollback = false; } - } else if (newValue && newValue.name === "") { + } else if (newValue && !newValue.name) { $scope.newConfig = true; $scope.oldName = ""; $scope.clearMessages();