From 86114c832e93e6a0614981d2fec8459447298ea4 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Thu, 22 Feb 2024 13:13:18 -0400 Subject: [PATCH] Simplify code Co-authored-by: Miguel Angel --- src/components/vue-form-builder.vue | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/vue-form-builder.vue b/src/components/vue-form-builder.vue index 0799983fa..73eddfa2f 100644 --- a/src/components/vue-form-builder.vue +++ b/src/components/vue-form-builder.vue @@ -1145,9 +1145,6 @@ export default { }, // This function is used to calculate the new index of the references calcNewIndexFor(index, referencedBy) { - if (index > this.pageDelete) { - return index - 1; - } if (index === this.pageDelete) { throw new Error( `${this.$t( @@ -1155,7 +1152,7 @@ export default { )}: ${referencedBy}` ); } - return index; + return index > this.pageDelete ? index - 1 : index; }, // Update Record list references updateRecordListReferences() {