Skip to content

Commit

Permalink
[BI-1258] prevent categories array from being zeroed out.
Browse files Browse the repository at this point in the history
  • Loading branch information
davedrp committed Jan 21, 2022
1 parent 2d31d67 commit 3e30449
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/components/trait/forms/CategoryTraitForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 3e30449

Please sign in to comment.