diff --git a/src/components/pages/NewCallForward/CscCallForwardGroup.vue b/src/components/pages/NewCallForward/CscCallForwardGroup.vue
index de1867b6..74d315f9 100644
--- a/src/components/pages/NewCallForward/CscCallForwardGroup.vue
+++ b/src/components/pages/NewCallForward/CscCallForwardGroup.vue
@@ -10,12 +10,7 @@
class="col col-xs-12 col-md-4 text-right csc-cf-group-title"
>
{{ !(groupsCount < 2 && (group.name.includes('timeout') || group.name.includes('unconditional'))) ? groupTitle :"" }}
-
+
-
-
-
-
-
@@ -183,10 +182,7 @@
}
break;
case "offline":{
- const offlineFwdGroup = await this.$store.dispatch('newCallForward/getForwardGroupByName', 'offline');
- if(!offlineFwdGroup){
- await this.$store.dispatch('newCallForward/addTempGroup','offline' );
- }
+ await this.$store.dispatch('newCallForward/addTempGroup','offline' );
}
break;
diff --git a/src/components/pages/NewCallForward/CscNewCallForwardAddDestinationForm.vue b/src/components/pages/NewCallForward/CscNewCallForwardAddDestinationForm.vue
index b30a0a24..ce91ff5a 100644
--- a/src/components/pages/NewCallForward/CscNewCallForwardAddDestinationForm.vue
+++ b/src/components/pages/NewCallForward/CscNewCallForwardAddDestinationForm.vue
@@ -116,6 +116,7 @@
});
}
else { // new destination
+ await this.$store.dispatch('newCallForward/setDestinationInCreation', true);
if(forwardGroup.id.toString().includes('temp-')){ // unexisting group
forwardGroup.destinations[0].simple_destination = this.number; // optimistic UI update :)
await this.$store.dispatch('newCallForward/addForwardGroup', {
@@ -124,7 +125,7 @@
});
}
else{ // existing group
- await this.$store.dispatch('newCallForward/setDestinationInCreation', true);
+
await this.$store.dispatch('newCallForward/addDestination', {
forwardGroupId: forwardGroup.id,
destination: this.number
diff --git a/src/store/new-call-forward.js b/src/store/new-call-forward.js
index 4d3ba434..59fa7ab3 100644
--- a/src/store/new-call-forward.js
+++ b/src/store/new-call-forward.js
@@ -93,8 +93,13 @@ export default {
state.mappings = mappings;
},
loadForwardGroups(state, forwardGroups){
- if(forwardGroups[0] && (forwardGroups[0].name.includes('unconditional') || forwardGroups[0].name.includes('timeout'))){
- forwardGroups.push(forwardGroups.shift())
+
+ for (let i = 0; i < forwardGroups.length; i++) {
+ const group = forwardGroups[i];
+ if (!group.name.includes('unconditional') && !group.name.includes('timeout')){
+ forwardGroups.splice(i, 1);
+ forwardGroups.unshift(group);
+ }
}
state.forwardGroups = forwardGroups;
},