From ddbfca344756fe0641c3307b1c8f38ba3f71db06 Mon Sep 17 00:00:00 2001 From: phroggster Date: Sun, 6 Apr 2025 06:48:49 -0500 Subject: [PATCH] fix(effects): Condition of 0 was [Not Set] (#3086) - This was overlooked in #2986. --- .../conditional-effect/conditionDisplay.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/app/directives/conditional-effect/conditionDisplay.js b/src/gui/app/directives/conditional-effect/conditionDisplay.js index 5e3fc4757..721f6f937 100644 --- a/src/gui/app/directives/conditional-effect/conditionDisplay.js +++ b/src/gui/app/directives/conditional-effect/conditionDisplay.js @@ -47,7 +47,7 @@ function getRightSideValueDisplay() { return $q(async (resolve) => { - if ($ctrl.condition == null || $ctrl.condition.rightSideValue == null || $ctrl.condition.rightSideValue === "") { + if ($ctrl.condition == null || $ctrl.condition.rightSideValue === null || $ctrl.condition.rightSideValue === undefined || $ctrl.condition.rightSideValue === "") { resolve("[Not Set]"); } else { const value = await $injector.invoke($ctrl.conditionType.getRightSideValueDisplay, {}, { @@ -60,7 +60,7 @@ function getLeftSideValueDisplay() { return $q(async (resolve) => { - if ($ctrl.condition == null || $ctrl.condition.leftSideValue == null || $ctrl.condition.leftSideValue === "") { + if ($ctrl.condition == null || $ctrl.condition.leftSideValue === null || $ctrl.condition.leftSideValue === undefined || $ctrl.condition.leftSideValue === "") { resolve("[Not Set]"); } else { const value = await $injector.invoke($ctrl.conditionType.getLeftSideValueDisplay, {}, { @@ -73,19 +73,19 @@ $ctrl.$onInit = function() { getRightSideValueDisplay().then((value) => { - $ctrl.rightSideValueDisplay = value || "[Not Set]"; + $ctrl.rightSideValueDisplay = value !== null && value !== undefined ? value : "[Not Set]"; }); getLeftSideValueDisplay().then((value) => { - $ctrl.leftSideValueDisplay = value || "[Not Set]"; + $ctrl.leftSideValueDisplay = value !== null && value !== undefined ? value : "[Not Set]"; }); }; $ctrl.$onChanges = function() { getRightSideValueDisplay().then((value) => { - $ctrl.rightSideValueDisplay = value || "[Not Set]"; + $ctrl.rightSideValueDisplay = value !== null && value !== undefined ? value : "[Not Set]"; }); getLeftSideValueDisplay().then((value) => { - $ctrl.leftSideValueDisplay = value || "[Not Set]"; + $ctrl.leftSideValueDisplay = value !== null && value !== undefined ? value : "[Not Set]"; }); }; }