Skip to content

Open source personal finance application

refactor(StatRound): find max width

ilkomec93a2eb563eb
diff --git a/components/stat/group/Round.vue b/components/stat/group/Round.vue
index 9bec208a..87b68e0f 100644
--- a/components/stat/group/Round.vue
+++ b/components/stat/group/Round.vue
@@ -26,8 +26,7 @@ function updateWidth() {
?.querySelector(`[data-type-text="${props.typeText}"]`)
?.querySelectorAll('.js-getWidth')
- const minWidth: number = Array.from(elements)
- .reduce((acc, e) => e.clientWidth > acc && e.clientWidth, 60)
+ const minWidth: number = Math.max(...Array.from(elements).map(e => e.clientWidth)) || 60
roundRef.value
?.querySelector(`[data-type-text="${props.typeText}"]`)