Open source personal finance application
chore: refactor
ilkomec41c02930f39
diff --git a/components/categories/types.ts b/components/categories/types.tsindex 77a7ea8a..6d358108 100644--- a/components/categories/types.ts+++ b/components/categories/types.ts@@ -1,8 +1,9 @@export type CategoryID = stringexport interface CategoryItem {- name: stringcolor: string+ icon: string+ name: stringparentId: CategoryID | 0childIds?: CategoryID[]}diff --git a/components/trns/list/TrnsListDate.vue b/components/date/TrnsDay.vuesimilarity index 82%rename from components/trns/list/TrnsListDate.vuerename to components/date/TrnsDay.vueindex b46396d4..5193dc5e 100644--- a/components/trns/list/TrnsListDate.vue+++ b/components/date/TrnsDay.vue@@ -1,20 +1,11 @@-<script>+<script setup lang="ts">import { formatDate } from '~/utils/formatDate'-export default {- props: {- date: {- type: String,- required: true,- },- },-- computed: {- formattedDate() {- return formatDate(this.date, 'full')- },- },-}+const props = defineProps<{+ date: number+}>()++const formattedDate = computed(() => formatDate(props.date, 'full'))</script><template lang="pug">diff --git a/components/shared/contextMenu/ContextMenuItem.vue b/components/shared/contextMenu/ContextMenuItem.vueindex 10cc961d..6e3d9fc8 100644--- a/components/shared/contextMenu/ContextMenuItem.vue+++ b/components/shared/contextMenu/ContextMenuItem.vue@@ -20,7 +20,7 @@ export default {</script><template lang="pug">-.item.grow(+.item.grow.my-2(:class="{ _selected: selected, _grow: grow }"@click="handleClick")@@ -42,7 +42,6 @@ export default {flex-grow 0max-width 400pxmin-height 44px- margin $m4 0padding 0 $m6font-size 14pxborder-radius $m5diff --git a/components/stat/Trns.vue b/components/stat/Trns.vuedeleted file mode 100644index 43262eb4..00000000--- a/components/stat/Trns.vue+++ /dev/null@@ -1,7 +0,0 @@-<template lang="pug">-.my-4- .pb-2.text-lg.leading-none.font-nunito.font-semibold.text-skin-item-base {{ $t('trns.inPeriodTitle') }}-- .md_max-w-none(class="max-w-[420px]")- TrnsList(:size="12")-</template>diff --git a/components/stat/group/Horizontal.vue b/components/stat/group/Horizontal.vueindex 0d4857f1..aeec31d3 100644--- a/components/stat/group/Horizontal.vue+++ b/components/stat/group/Horizontal.vue@@ -11,7 +11,9 @@ const { statPage } = useStatPage()const { ui } = useUIView()const { moneyTypes } = useStat()-const isShow = computed(() => ui.showCatsHorizontalList && statPage.current[props.typeText]?.categoriesIds?.length)+const isShow = computed(() =>+ ui.showCatsHorizontalList && statPage.current[props.typeText]?.categoriesIds?.length)+const typeNumber = moneyTypes.find(t => t.id === props.typeText)?.type</script>@@ -23,7 +25,6 @@ const typeNumber = moneyTypes.find(t => t.id === props.typeText)?.type:biggest="statPage.current[typeText].biggest":category="$store.state.categories.items[categoryId]":categoryId="categoryId"- :currencyCode="$store.state.currencies.base":total="statPage.current.categories[categoryId][typeText]":type="typeNumber")diff --git a/components/stat/group/HorizontalItem.vue b/components/stat/group/HorizontalItem.vueindex 51d74f77..6193f9dc 100644--- a/components/stat/group/HorizontalItem.vue+++ b/components/stat/group/HorizontalItem.vue@@ -1,49 +1,45 @@-<script lang="ts">+<script setup lang="ts">+import type { CategoryID, CategoryItem } from '~/components/categories/types'import useFilter from '~/modules/filter/useFilter'--export default {- props: {- biggest: { type: Number, required: true },- category: { type: Object, required: true },- categoryId: { type: String, required: true },- currencyCode: { type: String, required: true },- total: { type: Number, required: true },- type: { type: Number, required: true },- },-- setup() {- const { setFilterCatsId } = useFilter()-- return {- setFilterCatsId,- }- },-- data() {- return {- isShowInside: false,- }- },-- computed: {- isCategoryHasChildren() {- return this.$store.getters['categories/isCategoryHasChildren'](this.categoryId)- },-- styles() {- return {- width: `${Math.abs(this.total) / Math.abs(this.biggest) * 100}%`,- background: this.category.color,- }- },- },-- methods: {- toggleShowInside() {- this.isShowInside = !this.isShowInside- },- },+import type { TrnType } from '~/components/trns/types'+import useStatPage from '~/components/stat/useStatPage'++const props = defineProps<{+ biggest: number+ total: number+ type: TrnType+ category: CategoryItem+ categoryId: CategoryID+}>()++const { $store } = useNuxtApp()+const { statPage } = useStatPage()+const { setFilterCatsId } = useFilter()+const isShowInside = ref(false)++const isCategoryHasChildren = computed(() =>+ $store.getters['categories/isCategoryHasChildren'](props.categoryId))++const styles = computed(() => ({+ width: `${Math.abs(props.total) / Math.abs(props.biggest) * 100}%`,+ background: props.category.color,+}))++function toggleShowInside() {+ isShowInside.value = !isShowInside.value}++const trnsIds = computed(() => {+ if (isCategoryHasChildren.value)+ return []++ const trnsItems = $store.state.trns.items+ const trnsIds = statPage.current.trnsIds+ .filter(id => trnsItems[id].type === props.type && trnsItems[id].categoryId === props.categoryId)+ .sort((a, b) => trnsItems[b].date - trnsItems[a].date)++ return trnsIds+})</script><template lang="pug">@@ -68,7 +64,7 @@ export default {.statItem__amount.text-skin-item-baseAmount(:amount="total"- :currencyCode="currencyCode"+ :currencyCode="$store.state.currencies.base":type="type":isShowBaseRate="false")@@ -86,13 +82,12 @@ export default {:type="type")- template(v-else)+ template(v-if="!isCategoryHasChildren").statItem__trnsTrnsList(- :income="type === 1"- :expense="type === 0"- :categoryId="categoryId"- ui="stat"+ :trnsIds="trnsIds"+ :isShowGroupDate="false"+ uiCat)</template>diff --git a/components/stat/group/HorizontalItemCatItem.vue b/components/stat/group/HorizontalItemCatItem.vueindex 822e68ce..a8247f74 100644--- a/components/stat/group/HorizontalItemCatItem.vue+++ b/components/stat/group/HorizontalItemCatItem.vue@@ -1,44 +1,43 @@-<script>+<script setup lang="ts">+import type { CategoryID, CategoryItem } from '~/components/categories/types'import useFilter from '~/modules/filter/useFilter'--export default {- props: {- biggest: { type: Number, required: true },- category: { type: Object, required: true },- categoryId: { type: String, required: true },- total: { type: Number, required: true },- type: { type: Number, required: true },- },-- setup() {- const { setFilterCatsId } = useFilter()-- return {- setFilterCatsId,- }- },-- data() {- return {- isShowInside: false,- }- },-- computed: {- styles() {- return {- width: `${Math.abs(this.total) / Math.abs(this.biggest) * 100}%`,- background: this.category.color,- }- },- },-- methods: {- toggleShowInside() {- this.isShowInside = !this.isShowInside- },- },+import type { TrnType } from '~/components/trns/types'+import useStatPage from '~/components/stat/useStatPage'++const props = defineProps<{+ biggest: number+ total: number+ type: TrnType+ category: CategoryItem+ categoryId: CategoryID+}>()++const { $store } = useNuxtApp()+const { statPage } = useStatPage()+const { setFilterCatsId } = useFilter()+const isShowInside = ref(false)++const isCategoryHasChildren = computed(() =>+ $store.getters['categories/isCategoryHasChildren'](props.categoryId))++function toggleShowInside() {+ isShowInside.value = !isShowInside.value}++const trnsIds = computed(() => {+ if (isCategoryHasChildren.value)+ return []++ const trnsItems = $store.state.trns.items+ const trnsIds = statPage.current.trnsIds+ .filter((id) => {+ const trn = trnsItems[id]+ return trn.type === props.type && trn.categoryId === props.categoryId+ })+ .sort((a, b) => trnsItems[b].date - trnsItems[a].date)++ return trnsIds+})</script><template lang="pug">@@ -71,10 +70,9 @@ export default {@click.stop="")TrnsList(- :income="type === 1"- :expense="type === 0"- :categoryId="categoryId"- ui="stat"+ :isShowGroupDate="false"+ :trnsIds="trnsIds"+ uiCat)</template>diff --git a/components/stat/mobile/MenuSlider.vue b/components/stat/mobile/MenuSlider.vuedeleted file mode 100644index 69f3eb45..00000000--- a/components/stat/mobile/MenuSlider.vue+++ /dev/null@@ -1,40 +0,0 @@-<script setup lang="ts">-const props = defineProps<{- slider: any-}>()--const { $store } = useNuxtApp()-const { nuxt2Context: { i18n } } = useNuxtApp()--function onClickStatMenu(idx) {- props.slider.slideTo(idx, 0)-}--const menu = computed(() => [{- idx: 0,- name: i18n.t('stat.periods'),-}, {- idx: 1,- name: i18n.t('money.expense'),-}, {- idx: 2,- name: i18n.t('money.income'),-}, {- idx: 3,- name: i18n.t('trns.shortTitle'),-}, {- idx: 4,- name: i18n.t('trns.history'),-}])-</script>--<template lang="pug">-UiTabs2(v-if="slider")- UiTabsItem2(- v-for="item in menu"- v-if="!item.isPrivate || $store.getters['user/isDevUser']"- :key="item.name"- :isActive="slider.activeIndex === item.idx"- @click="onClickStatMenu(item.idx)"- ) {{ item.name }}-</template>diff --git a/components/stat/mobile/Slide.vue b/components/stat/mobile/Slide.vuedeleted file mode 100644index 2cd186dd..00000000--- a/components/stat/mobile/Slide.vue+++ /dev/null@@ -1,17 +0,0 @@-<script setup lang="ts">-import useStatPage from '~/components/stat/useStatPage'-const { statPage } = useStatPage()-</script>--<template lang="pug">-.swiper-slide.h-full.overflow-hidden.overflow-y-auto(- class="pt-[70px] pb-[44px]"-)- .my-6.mx-2.p-3.rounded-lg.bg-skin-item-main-active(v-if="statPage.filter.isShow")- LazyStatFilter(v-if="statPage.filter.isShow")-- slot-- .my-6- StatPeriodArrows-</template>diff --git a/components/stat/mobile/View.vue b/components/stat/mobile/View.vueindex 3899f233..8ae69448 100644--- a/components/stat/mobile/View.vue+++ b/components/stat/mobile/View.vue@@ -2,14 +2,16 @@import useStat from '~/modules/stat/useStat'import useStatChart from '~/components/stat/useStatChart'import useStatPage from '~/components/stat/useStatPage'+import useTrns from '~/components/trns/useTrns'import useUIView from '~/components/layout/useUIView'import useWallets from '~/components/wallets/useWallets'-const { walletsCurrencies } = useWallets()const { $store } = useNuxtApp()+const { walletsCurrencies } = useWallets()const { statPage } = useStatPage()const { ui } = useUIView()-const { moneyTypes, isEmptyStat } = useStat()+const { moneyTypes } = useStat()+const { allTrnsWithFilter } = useTrns()const { onWatch } = useStatChart()onWatch()@@ -27,19 +29,6 @@ const isShowGroup = (type) => {return p1 && p2}-const isShowTrns = computed(() => {- return statPage.activeTab === 'details'- && statPage.average?.income !== 0- && statPage.average?.expense !== 0- && $store.getters['trns/selectedTrnsIdsWithDate'].length > 0-})--const isShowGroupTrns = computed(() => {- const p1 = statPage.activeTab === 'income' || statPage.activeTab === 'expense'- const p2 = statPage.average?.sum === 0- return (p1 || p2) && statPage.activeTab !== 'history'-})-const chartKeyDirtyFix = ref('show')onActivated(async () => {await nextTick()@@ -100,9 +89,7 @@ onDeactivated(async () => {:key="item.id"class="max-w-[420px]")- StatSumGroup(- :typeText="item.id"- )+ StatSumGroup(:typeText="item.id")template(v-if="statPage.activeTab !== 'balance'")StatGroupEmpty(:typeText="item.id")@@ -126,13 +113,15 @@ onDeactivated(async () => {.grid.md_grid-cols-2.md_gap-x-20TrnsList(:size="50"+ :trnsIds="statPage.current.trnsIds"classNames="md_grid-cols-1"+ uiHistory)//- Historytemplate(v-if="statPage.activeTab === 'history'")- .my-6.px-2- StatHistory+ .my-4.px-2.md_max-w-none(class="max-w-[420px]")+ TrnsListWithControl(:trnsIds="allTrnsWithFilter")</template><style lang="stylus">diff --git a/components/trnForm/Categories.vue b/components/trnForm/Categories.vueindex 15988f7a..0e2f471d 100644--- a/components/trnForm/Categories.vue+++ b/components/trnForm/Categories.vue@@ -43,7 +43,7 @@ export default {</script><template lang="pug">-.contentWrap+.contentWrap.h-full.grid(class="grid-rows-[1fr,auto]").contentWrap__box.swiper-container(ref="trnFormCategories").swiper-wrapper@@ -88,19 +88,19 @@ export default {).py-2.px-3(v-if="slider")- .overflow-hidden.flex.items-center.text-center.text-xs.rounded-md.bg-gray-50.dark_bg-dark4.dark_shadow- .cursor-pointer.px-5.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(- :class="{ '_active cursor-default text-blue3 dark_text-blue1 bg-gray-100 dark_bg-232323': slider.activeIndex === 0 }"+ UiTabs+ UiTabsItem(+ :isActive="slider.activeIndex === 0"@click="slider.slideTo(0)") {{ $t('categories.lastUsedTitle') }}- .cursor-pointer.px-5.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(- :class="{ '_active cursor-default text-blue3 dark_text-blue1 bg-gray-100 dark_bg-232323': slider.activeIndex === 1 }"+ UiTabsItem(+ :isActive="slider.activeIndex === 1"@click="slider.slideTo(1)") {{ $t('categories.allTitle') }}- .cursor-pointer.px-5.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(- :class="{ '_active cursor-default text-blue3 dark_text-blue1 bg-gray-100 dark_bg-232323': slider.activeIndex === 2 }"+ UiTabsItem(+ :isActive="slider.activeIndex === 2"@click="slider.slideTo(2)") {{ $t('categories.favoriteTitle') }}</template>@@ -109,8 +109,6 @@ export default {.contentWrapoverflow hiddenposition relative- display grid- height 100%&__boxoverflow hiddendiff --git a/components/trnForm/TrnForm.vue b/components/trnForm/Index.vuesimilarity index 99%rename from components/trnForm/TrnForm.vuerename to components/trnForm/Index.vueindex 8442b29c..a80920cd 100644--- a/components/trnForm/TrnForm.vue+++ b/components/trnForm/Index.vue@@ -203,7 +203,7 @@ function handleSubmitForm() {.swiper-wrapper//- History.swiper-slide(:style="{ height: maxHeight }")- TrnFormTrns(+ TrnFormTrnsSlide(v-if="sliderObj":slider="sliderObj")diff --git a/components/trnForm/Trns.vue b/components/trnForm/Trns.vuedeleted file mode 100644index 52fed364..00000000--- a/components/trnForm/Trns.vue+++ /dev/null@@ -1,175 +0,0 @@-<script lang="ts">-import { getTrnsIds } from '~/components/trns/getTrns'--export default defineComponent({- props: {- categoryId: { type: String, default: null },- limit: { type: Number, default: 0 },- size: { type: Number, required: false, default: 10 },- slider: { type: Object, required: true },- },-- data() {- return {- pageNumber: 1,- filterBy: 'wallet',- }- },-- computed: {- isShowedAllTrns() {- return this.paginatedTrnsIds.length === this.trnsIds.length- },-- paginatedTrnsIds() {- const end = this.pageNumber * this.size- return this.trnsIds.slice(0, end)- },-- trnsIds() {- const trnsItems = this.$store.state.trns.items-- const filter = {- walletsIds: null,- categoriesIds: null,- }-- if (this.filterBy === 'wallet') {- filter.walletsIds = [this.$store.state.trnForm.values.walletId]- }- else if (this.filterBy === 'walletAndCategory') {- const catId = this.$store.state.trnForm.values.categoryId- const category = this.$store.state.categories.items[catId]-- filter.walletsIds = [this.$store.state.trnForm.values.walletId]- // TODO: create function- filter.categoriesIds = category?.childIds ?? [catId]- }-- const trnsIds = getTrnsIds({ ...filter, trnsItems })-- // limit- if (this.limit > 0)- return trnsIds.slice(0, this.limit)- return trnsIds- },-- // TODO: duplicate function- // Maybe move to trns- groupedTrns() {- const trnsItems = this.$store.state.trns.items- const trnsIds = this.paginatedTrnsIds-- return trnsIds.reduce((acc, trnId) => {- const date = this.$day(trnsItems[trnId].date).startOf('day').valueOf()- acc[date] ??= []- acc[date].push(trnId)- return acc- }, {})- },- },-- methods: {- showMoreTrns() {- this.pageNumber = this.pageNumber + 1- setTimeout(() => {- this.slider.update()- this.slider.slideTo(0, 0)- }, 100)- },-- changeFilter(filterBy) {- const trnForm = document.querySelector('.trnForm')- const trnsListScroll = trnForm.querySelector('.trnsListScroll')- trnsListScroll.scrollTop = 0-- this.filterBy = filterBy- this.pageNumber = 1- setTimeout(() => {- this.slider.slideTo(0, 0)- }, 100)- },- },-})-</script>--<template lang="pug">-.contentWrap- .contentWrap__box.trnsListScroll.scrollerBlock- .containerWrap(v-if="trnsIds.length === 0") No transactions-- .scrollBlock- .pt-5- .subTitle.text-center.pb-1.text-xs {{ $t('trns.history') }}-- .overflow-hidden.mx-3.my-2.rounded-md.bg-gray-50.dark_bg-dark4(- v-for="(trnsIds, date) in groupedTrns"- :key="date"- )- .pt-4- .pb-2.px-3- TrnsListDate(:date="date")-- .overflow-hidden.rounded-md- TrnsItemHistory.py-3.px-2.rounded-md(- v-for="trnId in trnsIds"- :key="trnId"- :slider="slider"- :trnId="trnId"- )-- .py-4.pb-6.px-3.flex-center(v-if="!isShowedAllTrns")- .cursor-pointer.grow.py-3.px-5.flex-center.rounded-full.text-sm.bg-skin-item-main-bg.hocus_bg-skin-item-main-hover(- class="basis-1/2 max-w-[280px]"- @click="showMoreTrns"- ) {{ $t('trns.more') }}-- .pt-2.pb-5.px-3- .overflow-hidden.rounded-md.items-center.flex.text-xs.text-center.bg-gray-50.dark_bg-dark4.dark_shadow- .cursor-pointer.px-5.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(- :class="{ '_active cursor-default text-blue3 dark_text-blue1 bg-gray-100 dark_bg-232323': filterBy === 'wallet' }"- @click="changeFilter('wallet')"- ) {{ $t('trnForm.filterWallet') }}-- .cursor-pointer.px-5.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(- :class="{ '_active cursor-default text-blue3 dark_text-blue1 bg-gray-100 dark_bg-232323': filterBy === 'walletAndCategory' }"- @click="changeFilter('walletAndCategory')"- ) {{ $t('trnForm.filterWalletAndCategory') }}-- .cursor-pointer.px-5.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(- :class="{ '_active cursor-default text-blue3 dark_text-blue1 bg-gray-100 dark_bg-232323': filterBy === 'all' }"- @click="changeFilter('all')"- ) {{ $t('trnForm.filterAll') }}-</template>--<style lang="stylus" scoped>-.containerWrap- display flex- align-items center- justify-content center- height 100%- min-height 100%- padding $m10 $m7- color var(--c-font-3)- font-size 26px- font-weight 700- text-align center- fontFamilyNunito()--.contentWrap- position relative- display grid- grid-template-rows 1fr auto- height 100%-- &__box- overflow hidden- overflow-y auto- scrollbar()--.subTitle- color var(--c-font-4)- letter-spacing 0- font-weight 600- text-transform uppercase-</style>diff --git a/pages/settings.vue b/pages/settings.vueindex ee5808fb..92314f88 100644--- a/pages/settings.vue+++ b/pages/settings.vue@@ -19,6 +19,8 @@ function removeUserData() {if (route.name !== 'welcome')router.push('/welcome')}++const user = computed(() => $store.state.user?.user)</script><script lang="ts">@@ -65,12 +67,12 @@ UiPage)//- User- .pb-12+ .pb-12(v-if="user").pb-3.text-skin-item-base.text-lg.leading-none.font-nunito.font-semibold| {{ $t('user') }}.pb-3.text-neutral-400- .text-lg {{ $store.state.user.user.displayName }}- .text-sm {{ $store.state.user.user.email }}+ .text-lg {{ user.displayName }}+ .text-sm {{ user.email }}SharedButton._bdb(:title="$t('userLogout')"diff --git a/store/categories/mutations.js b/store/categories/mutations.jsindex e439b8b0..16108194 100644--- a/store/categories/mutations.js+++ b/store/categories/mutations.js@@ -1,8 +1,10 @@export default {setCategories(state, items) {const freezedItems = {}- for (const itemId of Object.keys(items))- freezedItems[itemId] = Object.freeze(items[itemId])+ if (items) {+ for (const itemId of Object.keys(items))+ freezedItems[itemId] = Object.freeze(items[itemId])+ }state.items = {...freezedItems,diff --git a/store/stat/getters.ts b/store/stat/getters.tsindex e4b77aaf..30fa6100 100644--- a/store/stat/getters.ts+++ b/store/stat/getters.ts@@ -1,4 +1,6 @@import dayjs from 'dayjs'+import type { CategoryID } from '~/components/categories/types'+import type { TrnID } from '~/components/trns/types'import { getCategoriesIds, getTransferCategoriesIds } from '~/components/categories/getCategories'import { getTotal } from '~/components/amount/getTotal'import { getTrnsIds } from '~/components/trns/getTrns'@@ -32,24 +34,24 @@ export default {walletsIds,})- function getRootCategoryIdFromTrnId(trnId) {+ function getRootCategoryIdFromTrnId(trnId: TrnID, excludeTransfer = false): CategoryID {const categories = rootState.categories.itemsconst trnCategoryId = trnsItems[trnId].categoryIdconst trnCategoryParentId = categories[trnCategoryId].parentId- return trnCategoryParentId || trnCategoryId+ const categoryId = trnCategoryParentId || trnCategoryId++ if (excludeTransfer && transferCategoriesIds.includes(categoryId))+ return null++ return categoryId}function getCategoriesIdsWithTrnsIds() {const categoriesWithTrnsIds = {}for (const trnId of trnsIds) {- if (!trnsItems[trnId])- continue-- const categoryId = getRootCategoryIdFromTrnId(trnId)-- const isTransferCategory = transferCategoriesIds.includes(categoryId)- if (isTransferCategory)+ const categoryId = getRootCategoryIdFromTrnId(trnId, true)+ if (!categoryId)continuecategoriesWithTrnsIds[categoryId] ??= []@@ -92,12 +94,6 @@ export default {}}- // sort categories amount- function sortCategoriesByTotal(categories, typeName) {- const categoriesIds = Object.keys(categories)- return categoriesIds.sort((a, b) => categories[b][typeName] - categories[a][typeName])- }-// separate categories by income and expenseconst statIncome = {}const statExpense = {}@@ -110,8 +106,10 @@ export default {}// sorted- const incomeCategoriesIds = sortCategoriesByTotal(statIncome, 'income')- const expenseCategoriesIds = sortCategoriesByTotal(statExpense, 'expense')+ const incomeCategoriesIds = Object.keys(statIncome)+ .sort((a, b) => statIncome[b].income - statIncome[a].income)+ const expenseCategoriesIds = Object.keys(statExpense)+ .sort((a, b) => statExpense[b].expense - statExpense[a].expense)// get first item in sorted categoriesfunction getBiggestAmount(categoriesTotal, categoriesIds, typeName) {@@ -124,6 +122,7 @@ export default {const incomeBiggest = getBiggestAmount(categoriesTotal, incomeCategoriesIds, 'income')return {+ trnsIds: trnsIds.sort((a, b) => trnsItems[b].date - trnsItems[a].date),categories: categoriesTotal,total: total.sumTransactions,expense: {diff --git a/store/trns/mutations.js b/store/trns/mutations.jsindex a0f52f8d..3a581ecb 100644--- a/store/trns/mutations.js+++ b/store/trns/mutations.js@@ -5,6 +5,7 @@ export default {for (const itemId of Object.keys(items))freezedItems[itemId] = Object.freeze(items[itemId])}+state.items = freezedItems},diff --git a/store/wallets/mutations.js b/store/wallets/mutations.jsindex 09eb3158..6125490c 100644--- a/store/wallets/mutations.js+++ b/store/wallets/mutations.js@@ -5,6 +5,7 @@ export default {for (const itemId of Object.keys(items))freezedItems[itemId] = Object.freeze(items[itemId])}+state.items = freezedItems},}