From c7471fdac4ccb4f4a3bfa5d3d6de46deca561557 Mon Sep 17 00:00:00 2001 From: vicent Date: Tue, 31 May 2022 12:21:04 +0200 Subject: [PATCH] refator: variable names changed --- modules/zone/front/events/index.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/modules/zone/front/events/index.js b/modules/zone/front/events/index.js index 447aa1da8..31685c338 100644 --- a/modules/zone/front/events/index.js +++ b/modules/zone/front/events/index.js @@ -72,25 +72,27 @@ class Controller extends Section { else this.createInclusion(type, days, weekday); } else { - if (geoExclusions.length) - this.editExclusion(geoExclusions); - else if (exclusions.length) - this.editExclusion(exclusions); - else + if (geoExclusions.length) { + this.geoExclusions = geoExclusions; + this.editExclusion(); + } else if (exclusions.length) { + this.exclusions = exclusions; + this.editExclusion(); + } else this.createExclusion(days); } } - editExclusion(allTypeExclusions) { + editExclusion() { this.isNew = false; - this.excludeSelected = angular.copy(allTypeExclusions[0]); - if (this.excludeSelected.geoFk) { + if (this.geoExclusions) { + this.excludeSelected = angular.copy(this.geoExclusions[0]); this.excludeSelected.type = 'specificLocations'; - this.geoExclusions = allTypeExclusions; - } else { + } + if (this.exclusions) { + this.excludeSelected = angular.copy(this.exclusions[0]); this.excludeSelected.type = 'all'; - this.exclusions = allTypeExclusions; } this.$.excludeDialog.show();