Skip to content

Open source personal finance application

chore: clean up

ilkome269aab7a0fd3
diff --git a/components/stat/group/Round.vue b/components/stat/group/Round.vue
index 87b68e0f..cca760f2 100644
--- a/components/stat/group/Round.vue
+++ b/components/stat/group/Round.vue
@@ -26,7 +26,9 @@ function updateWidth() {
?.querySelector(`[data-type-text="${props.typeText}"]`)
?.querySelectorAll('.js-getWidth')
- const minWidth: number = Math.max(...Array.from(elements).map(e => e.clientWidth)) || 60
+ const minWidth: number = elements
+ ? Math.max(...Array.from(elements).map(e => e.clientWidth)) || 60
+ : 60
roundRef.value
?.querySelector(`[data-type-text="${props.typeText}"]`)
diff --git a/components/trns/item/Details.vue b/components/trns/item/Details.vue
index b862672d..945e6514 100644
--- a/components/trns/item/Details.vue
+++ b/components/trns/item/Details.vue
@@ -47,7 +47,6 @@ export default {
const { setExpression } = useCalculator()
setExpression(this.trn.type === 2 && this.trn.incomeAmount ? this.trn.incomeAmount : this.trn.amount)
this.$store.dispatch('trnForm/openTrnForm', { action: 'edit', trnId })
- this.$store.commit('stat/setCategoryModal', { id: null, type: null })
this.$emit('onClickEdit', this.trnId)
},
},
diff --git a/components/trns/item/History.vue b/components/trns/item/History.vue
index d79e1faf..02934dca 100644
--- a/components/trns/item/History.vue
+++ b/components/trns/item/History.vue
@@ -31,7 +31,6 @@ const actions = {
setExpression(trnItem.value.type === 2 && trnItem.value.incomeAmount ? trnItem.value.incomeAmount : trnItem.value.amount)
$store.dispatch('trnForm/openTrnForm', { action: 'edit', trnId: trnItem.value.id })
- $store.commit('stat/setCategoryModal', { id: null, type: null })
},
onSetFilter: (event) => {
@@ -43,7 +42,6 @@ const actions = {
$store.commit('filter/setFilterDateNow')
$store.commit('trns/hideTrnModal')
$store.commit('trns/setTrnModalId', null)
- $store.commit('stat/setCategoryModal', { id: null, type: null })
if ($store.state.ui.activeTabStat !== 'trns')
$store.dispatch('ui/setActiveTabStat', 'details')
},
diff --git a/components/trns/item/Modal.vue b/components/trns/item/Modal.vue
index 1d343c68..363ce7e7 100644
--- a/components/trns/item/Modal.vue
+++ b/components/trns/item/Modal.vue
@@ -51,7 +51,6 @@ export default {
this.$store.commit('filter/setFilterDateNow')
this.$store.commit('trns/hideTrnModal')
this.$store.commit('trns/setTrnModalId', null)
- this.$store.commit('stat/setCategoryModal', { id: null, type: null })
this.$store.dispatch('ui/setActiveTabStat', 'details')
},
@@ -68,7 +67,6 @@ export default {
this.$store.dispatch('trnForm/openTrnForm', { action: 'duplicate', trnId })
this.$store.commit('trns/hideTrnModal')
this.$store.commit('trns/setTrnModalId', null)
- this.$store.commit('stat/setCategoryModal', { id: null, type: null })
},
handleEditClick() {
@@ -77,7 +75,6 @@ export default {
this.$store.dispatch('trnForm/openTrnForm', { action: 'edit', trnId })
this.$store.commit('trns/hideTrnModal')
this.$store.commit('trns/setTrnModalId', null)
- this.$store.commit('stat/setCategoryModal', { id: null, type: null })
const { setExpression } = useCalculator()
setExpression(trn.type === 2 && trn.incomeAmount ? trn.incomeAmount : trn.amount)
diff --git a/components/trns/list/TrnsList.vue b/components/trns/list/TrnsList.vue
index b89321d3..4257b086 100644
--- a/components/trns/list/TrnsList.vue
+++ b/components/trns/list/TrnsList.vue
@@ -31,7 +31,6 @@ export default defineComponent({
event.stopPropagation()
setExpression(trnItem.type === 2 && trnItem.incomeAmount ? trnItem.incomeAmount : trnItem.amount)
$store.dispatch('trnForm/openTrnForm', { action: 'edit', trnId: trnItem.id })
- $store.commit('stat/setCategoryModal', { id: null, type: null })
},
onSetFilter: (event) => {
@@ -40,7 +39,6 @@ export default defineComponent({
$store.commit('filter/setFilterDateNow')
$store.commit('trns/hideTrnModal')
$store.commit('trns/setTrnModalId', null)
- $store.commit('stat/setCategoryModal', { id: null, type: null })
$store.dispatch('ui/setActiveTabStat', 'details')
},
})
diff --git a/components/trns/list/TrnsListHistory.vue b/components/trns/list/TrnsListHistory.vue
index cc3279d2..cd570ba7 100644
--- a/components/trns/list/TrnsListHistory.vue
+++ b/components/trns/list/TrnsListHistory.vue
@@ -18,7 +18,6 @@ const actions = trnItem => ({
event.stopPropagation()
setExpression(trnItem.type === 2 && trnItem.incomeAmount ? trnItem.incomeAmount : trnItem.amount)
$store.dispatch('trnForm/openTrnForm', { action: 'edit', trnId: trnItem.id })
- $store.commit('stat/setCategoryModal', { id: null, type: null })
},
onSetFilter: (event) => {
@@ -27,7 +26,6 @@ const actions = trnItem => ({
$store.commit('filter/setFilterDateNow')
$store.commit('trns/hideTrnModal')
$store.commit('trns/setTrnModalId', null)
- $store.commit('stat/setCategoryModal', { id: null, type: null })
$store.dispatch('ui/setActiveTabStat', 'details')
},
})
diff --git a/store/stat/actions.js b/store/stat/actions.js
deleted file mode 100644
index b8a44611..00000000
--- a/store/stat/actions.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export default {
- setDiffPeriods({ commit, dispatch }, value) {
- commit('setDiffPeriods', value)
- dispatch('ui/saveUiView', null, { root: true })
- },
-}
diff --git a/store/stat/index.js b/store/stat/index.js
index 19e40a45..ec637a31 100644
--- a/store/stat/index.js
+++ b/store/stat/index.js
@@ -1,7 +1 @@
-export const state = () => ({
- showedPeriods: 10,
- categoryModal: {
- id: null,
- type: null,
- },
-})
+export const state = () => ({})
diff --git a/store/stat/mutations.js b/store/stat/mutations.js
deleted file mode 100644
index 531bcd19..00000000
--- a/store/stat/mutations.js
+++ /dev/null
@@ -1,10 +0,0 @@
-export default {
- setDiffPeriods(state, value) {
- state.showedPeriods = parseInt(value) || 1
- },
-
- setCategoryModal(state, { id, type }) {
- state.categoryModal.id = id
- state.categoryModal.type = type
- },
-}