Open source personal finance application
26.10.2022-20:15
ilkomec648c3b6f8e4
diff --git a/components/amount/getTotal.ts b/components/amount/getTotal.tsindex 24fc6894..9b8dd2b2 100644--- a/components/amount/getTotal.ts+++ b/components/amount/getTotal.ts@@ -84,7 +84,7 @@ export function getTotal(props: TotalProps): TotalReturns {}// Transfer v2- if (trn.type === TrnType.Transfer && 'incomeWalletId' in trn) {+ else if (trn.type === TrnType.Transfer && 'incomeWalletId' in trn) {const incomeWallet = walletsItems[trn.incomeWalletId]const expenseWallet = walletsItems[trn.expenseWalletId]const incomeAmount = getAmount(trn.incomeAmount, incomeWallet.currency)@@ -109,7 +109,7 @@ export function getTotal(props: TotalProps): TotalReturns {}// Transfer @deprecated- if (trn.type === TrnType.Transfer && 'walletFromId' in trn) {+ else if (trn.type === TrnType.Transfer && 'walletFromId' in trn) {const incomeWallet = walletsItems[trn.walletToId]const expenseWallet = walletsItems[trn.walletFromId]const incomeAmount = getAmount(trn.amountTo, incomeWallet.currency)diff --git a/components/trnForm/calculator/useCalculator.ts b/components/trnForm/calculator/useCalculator.tsindex 540a3cf4..fc35fba1 100644--- a/components/trnForm/calculator/useCalculator.ts+++ b/components/trnForm/calculator/useCalculator.ts@@ -100,7 +100,7 @@ export default function useCalculator() {function createExpressionString(expression: string, value: string): string {const inputIsAction = Number.isNaN(Number.parseInt(value))- // Last simbol of expression+ // Last symbol of expressionconst clearedExpression = removeSpaces(expression)const lastSymbol = clearedExpression.slice(-1)const isLastSymbolAction = checkIsLastSymbolAction(lastSymbol)@@ -124,7 +124,7 @@ export default function useCalculator() {return value}- // Change math simbol+ // Change math symbolif (inputIsAction && isLastSymbolAction && !isDotAction && !isSumAction && !isDeleteAction)return clearedExpression.slice(0, -1) + value@@ -147,7 +147,7 @@ export default function useCalculator() {}}- // Add math simbol+ // Add math symbolif (inputIsAction)return clearedExpression + valuediff --git a/components/wallets/Total.vue b/components/wallets/Total.vueindex 4ce23fe2..ecdaeefa 100644--- a/components/wallets/Total.vue+++ b/components/wallets/Total.vue@@ -1,15 +1,14 @@<script setup lang="ts">-import { WalletID, WalletItem } from './types';+import type { WalletID, WalletItem } from './types'import useAmount from '~/components/amount/useAmount'import type { CurrencyCode } from '~/components/currencies/types'-const { $store } = useNuxtApp()-const { getAmountInBaseRate } = useAmount()-const props = defineProps<{- walletsItems: Record<WalletID, WalletItem>,+ walletsItems: Record<WalletID, WalletItem>currencyCode: CurrencyCode}>()+const { $store } = useNuxtApp()+const { getAmountInBaseRate } = useAmount()const totalInWallets = computed(() => {const walletsTotal = $store.getters['wallets/walletsTotal']diff --git a/components/wallets/page/List.vue b/components/wallets/page/List.vueindex f4d9a575..7976819a 100644--- a/components/wallets/page/List.vue+++ b/components/wallets/page/List.vue@@ -17,7 +17,7 @@ const walletsCurrenciesTabs = reactive({return state.value.activeTab}),- onSelect: v => {+ onSelect: (v) => {state.value.activeTab = vstate.value.activeTab = v},@@ -30,7 +30,7 @@ const walletsCurrenciesTabs = reactive({Object.entries(walletsItemsSorted.value).filter(([_key, value]) => value.currency === state.value.activeTab))- })+ }),})</script>@@ -116,7 +116,6 @@ UiPage:currencyCode="walletItem.currency")-//- Sort//-----------------------------------Portal(v-if="activeTab === 'walletsSort'" to="modal" key="walletsSort")diff --git a/components/wallets/useWallets.ts b/components/wallets/useWallets.tsindex 264b5dcf..870b062f 100644--- a/components/wallets/useWallets.ts+++ b/components/wallets/useWallets.ts@@ -37,8 +37,8 @@ export default function useWallets() {// TODO: check Areturn walletsIdsSorted.reduce((acc, id) => {const currency = walletsItems[id].currency- if (!acc.includes(currency))- acc.push(currency)+ !acc.includes(currency)+ && acc.push(currency)return acc}, [])})diff --git a/pages/wallets/total.vue b/pages/wallets/total.vueindex 7f1b3b82..6c8be11f 100644--- a/pages/wallets/total.vue+++ b/pages/wallets/total.vue@@ -186,13 +186,13 @@ const chartData = computed(() => _merge(JSON.parse(JSON.stringify(options)), cha.my-5h1.pb-2 Periods- UiTabs- UiTabsItem(- v-for="date in periods"- :key="date"- :isActive="activePeriod === date"- @click="activePeriod = date"- ) {{ date }}+ //- UiTabs+ //- UiTabsItem(+ //- v-for="date in periods"+ //- :key="date"+ //- :isActive="activePeriod === date"+ //- @click="activePeriod = date"+ //- ) {{ date }}.my-5h1 date