Open source personal finance application
fix: resolve TypeScript errors and remove debug logging
Ilya Komichev82e0581d7a88
diff --git a/app/components/app/useInitApp.ts b/app/components/app/useInitApp.tsindex 83ec9bb1..15f4583e 100644--- a/app/components/app/useInitApp.ts+++ b/app/components/app/useInitApp.ts@@ -73,7 +73,7 @@ export function useInitApp() {walletsStore.setWallets(null)userStore.setUser(null)- const offlineKeys = new Set([STORAGE_KEYS.offlineQueue, STORAGE_KEYS.offlineQueueUserId])+ const offlineKeys: Set<string> = new Set([STORAGE_KEYS.offlineQueue, STORAGE_KEYS.offlineQueueUserId])for (const key of Object.values(STORAGE_KEYS)) {if (!offlineKeys.has(key))localforage.removeItem(key)diff --git a/app/components/search/SearchCommandPalette.vue b/app/components/search/SearchCommandPalette.vueindex 1fc34c05..486dc76e 100644--- a/app/components/search/SearchCommandPalette.vue+++ b/app/components/search/SearchCommandPalette.vue@@ -90,11 +90,12 @@ function getTransfer(item: SearchResultItem): TransferFull | undefined {<div class="flex w-full items-center gap-3"><UiIconBase:color="getCategory(rawItem as SearchResultItem)?.color"- :name="getCategory(rawItem as SearchResultItem)?.icon"+ :name="getCategory(rawItem as SearchResultItem)?.icon ?? ''"invert/><CategoriesName- :category="getCategory(rawItem as SearchResultItem)"+ v-if="getCategory(rawItem as SearchResultItem)"+ :category="getCategory(rawItem as SearchResultItem)!":parentCategory="getCategoryParent(rawItem as SearchResultItem)"isShowParentstacked@@ -131,7 +132,7 @@ function getTransfer(item: SearchResultItem): TransferFull | undefined {><div class="flex-center min-w-8"><UiIconBase- :name="getTrn(rawItem as SearchResultItem)?.category?.icon"+ :name="getTrn(rawItem as SearchResultItem)?.category?.icon ?? ''":color="getTrn(rawItem as SearchResultItem)?.category?.color"invert/>@@ -140,11 +141,11 @@ function getTransfer(item: SearchResultItem): TransferFull | undefined {<div class="grid grow gap-1 pr-1"><div class="flex grow items-center gap-3"><!-- Regular transaction -->- <template v-if="getTransaction(rawItem as SearchResultItem) as TransactionFull | undefined">+ <template v-if="getTransaction(rawItem as SearchResultItem)"><div class="grid grow gap-0.5"><CategoriesName- :category="getTransaction(rawItem as SearchResultItem)?.category"- :parentCategory="getTransaction(rawItem as SearchResultItem)?.categoryParent"+ :category="getTransaction(rawItem as SearchResultItem)!.category"+ :parentCategory="getTransaction(rawItem as SearchResultItem)!.categoryParent"isShowParent/><div class="flex items-center gap-2">@@ -155,11 +156,11 @@ function getTransfer(item: SearchResultItem): TransferFull | undefined {</div><Amount- :amount="getTransaction(rawItem as SearchResultItem)?.amount"- :currencyCode="getTransaction(rawItem as SearchResultItem)?.wallet?.currency"+ :amount="getTransaction(rawItem as SearchResultItem)!.amount"+ :currencyCode="getTransaction(rawItem as SearchResultItem)!.wallet.currency":isShowMinus="getTransaction(rawItem as SearchResultItem)?.type === TrnType.Expense":isShowPlus="getTransaction(rawItem as SearchResultItem)?.type === TrnType.Income"- :type="getTransaction(rawItem as SearchResultItem)?.type"+ :type="getTransaction(rawItem as SearchResultItem)!.type"align="right"class="grow"colorize="income"@@ -180,9 +181,9 @@ function getTransfer(item: SearchResultItem): TransferFull | undefined {<div class="flex flex-wrap gap-2"><Amount- :amount="getTransfer(rawItem as SearchResultItem)?.expenseAmount"+ :amount="getTransfer(rawItem as SearchResultItem)!.expenseAmount":colorize="getTransfer(rawItem as SearchResultItem)?.incomeAmount === getTransfer(rawItem as SearchResultItem)?.expenseAmount ? undefined : 'expense'"- :currencyCode="getTransfer(rawItem as SearchResultItem)?.expenseWallet?.currency"+ :currencyCode="getTransfer(rawItem as SearchResultItem)!.expenseWallet.currency":type="TrnType.Expense"class="!flex items-center gap-2"variant="sm"@@ -190,8 +191,8 @@ function getTransfer(item: SearchResultItem): TransferFull | undefined {<template v-if="getTransfer(rawItem as SearchResultItem)?.incomeAmount !== getTransfer(rawItem as SearchResultItem)?.expenseAmount"><Amount- :amount="getTransfer(rawItem as SearchResultItem)?.incomeAmount"- :currencyCode="getTransfer(rawItem as SearchResultItem)?.incomeWallet?.currency"+ :amount="getTransfer(rawItem as SearchResultItem)!.incomeAmount"+ :currencyCode="getTransfer(rawItem as SearchResultItem)!.incomeWallet.currency":type="TrnType.Income"colorize="income"class="!flex items-center gap-2"diff --git a/app/components/stat/Item.vue b/app/components/stat/Item.vueindex 27262e87..63e771c8 100644--- a/app/components/stat/Item.vue+++ b/app/components/stat/Item.vue@@ -4,7 +4,6 @@ import type { SeriesSlugSelected, StatTabSlug } from '~/components/stat/types'import type { TrnId } from '~/components/trns/types'import type { WalletId } from '~/components/wallets/types'-import { useCategoriesStore } from '~/components/categories/useCategoriesStore'import { filterKey, statConfigKey, statDateKey } from '~/components/stat/injectionKeys'import { useStatItem } from '~/components/stat/useStatItem'import { useTrnsStore } from '~/components/trns/useTrnsStore'@@ -24,7 +23,6 @@ const { t } = useI18n()const filter = inject(filterKey)!const statDate = inject(statDateKey)!const statConfig = inject(statConfigKey)!-const categoriesStore = useCategoriesStore()const trnsStore = useTrnsStore()const isOneCategory = computed(() => !!props.categoryId)@@ -153,7 +151,6 @@ function onClickSumItemWrap(type: SeriesSlugSelected) {v-if="selectedTrnsIds.length > 0"class="_min-h-dvh grid min-w-0 content-start items-start gap-4">-<div:class="{'grid gap-5 @3xl/stat:grid-cols-2 @3xl/stat:gap-6': shouldUseTwoColumnLayout,diff --git a/app/components/stat/Menu.vue b/app/components/stat/Menu.vueindex 0d81783f..4dc15d9a 100644--- a/app/components/stat/Menu.vue+++ b/app/components/stat/Menu.vue@@ -57,7 +57,7 @@ watch(() => props.active, () => {'rounded-none border-b border-b-1 !border-(--ui-primary)': item.id === props.active,'text-muted hover:mb-1 hover:bg-(--item-5) hover:pb-1': item.id !== props.active,}]"- class="rounded-lg px-3 py-1.5 pb-2 text-xs tracking-wide text-nowrap lg:text-sm"+ class="rounded-sm px-3 py-1.5 pb-2 text-xs tracking-wide text-nowrap lg:text-sm"@click="onClickStatMenu(item.id)">{{ item.name }}diff --git a/app/components/stat/categories/RoundSectionRecent.vue b/app/components/stat/categories/RoundSectionRecent.vueindex 76118313..ea45d0e6 100644--- a/app/components/stat/categories/RoundSectionRecent.vue+++ b/app/components/stat/categories/RoundSectionRecent.vue@@ -59,7 +59,7 @@ function onClick(categoryId: CategoryId) {<div class="size-6"><UiIconBase- :name="categoriesStore.items[categoryId]?.icon"+ :name="categoriesStore.items[categoryId]?.icon ?? ''":color="categoriesStore.items[categoryId]?.color":size="14"class="!w-6 p-1"diff --git a/app/components/user/useUserStore.ts b/app/components/user/useUserStore.tsindex 1fa8c528..517bda79 100644--- a/app/components/user/useUserStore.ts+++ b/app/components/user/useUserStore.ts@@ -201,7 +201,7 @@ export const useUserStore = defineStore('user', () => {setSessionInitialized(false)useCookie<boolean>('finapp.isOnboarded').value = false- const offlineKeys = new Set([STORAGE_KEYS.offlineQueue, STORAGE_KEYS.offlineQueueUserId])+ const offlineKeys: Set<string> = new Set([STORAGE_KEYS.offlineQueue, STORAGE_KEYS.offlineQueueUserId])await Promise.all(Object.values(STORAGE_KEYS).filter(key => !offlineKeys.has(key))diff --git a/nuxt.config.ts b/nuxt.config.tsindex aff0063a..773c1ae3 100644--- a/nuxt.config.ts+++ b/nuxt.config.ts@@ -68,10 +68,10 @@ export default defineNuxtConfig({icon: {clientBundle: {- collections: ['lucide', 'mdi'],icons: categoryIcons.flat(),scan: true,},+ collections: ['lucide', 'mdi'],},modules: [