Slight logic refactor

This commit is contained in:
Chloe Herd 2023-07-25 11:55:14 -04:00
parent 0fa12ca01c
commit 9c417e1c1b

View file

@ -25,12 +25,7 @@ export default {
}, },
computed: { computed: {
displayContent() { displayContent() {
let linesToDisplay = []; return [...this.windshieldCopy];
if (this.hasWindshieldDamage) {
linesToDisplay.push(this.windshieldString);
}
return linesToDisplay;
}, },
hasWindshieldDamage() { hasWindshieldDamage() {
return ( return (
@ -40,8 +35,12 @@ export default {
) )
); );
}, },
windshieldString() { windshieldCopy() {
return this.getCmsContent("WindshieldDamageWidget", "Text"); if (this.hasWindshieldDamage) {
return [this.getCmsContent("WindshieldDamageWidget", "Text")];
} else {
return [];
}
}, },
}, },
components: { components: {