From f1a0fc4c192598079b02c3e4a09d70b4fda2f3b4 Mon Sep 17 00:00:00 2001 From: David Randolph Phillips Date: Fri, 21 Jan 2022 10:33:18 -0500 Subject: [PATCH] [BI-1258] prevent categories array from being zeroed out. --- src/components/trait/forms/CategoryTraitForm.vue | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/trait/forms/CategoryTraitForm.vue b/src/components/trait/forms/CategoryTraitForm.vue index 555af1b3f..cc612b336 100644 --- a/src/components/trait/forms/CategoryTraitForm.vue +++ b/src/components/trait/forms/CategoryTraitForm.vue @@ -133,11 +133,10 @@ export default class CategoryTraitForm extends Vue { @Watch('type', {immediate: true}) updateCategories() { - if (this.data.filter((value,index) => { + this.data = this.data.filter((value,index) => { return (value.value !== undefined || value.label !== undefined); - }).length !== 0) { - this.data.splice(0, this.data.length) - } + }); + if (this.data.length === 0) { this.prepopulateCategories(); }