Skip to content

Open source personal finance application

fix: resolve TypeScript errors in categories store and vibrate API

Ilya Komicheve574076123e2
diff --git a/app/components/categories/useCategoriesStore.ts b/app/components/categories/useCategoriesStore.ts
index 820928fe..a0976998 100644
--- a/app/components/categories/useCategoriesStore.ts
+++ b/app/components/categories/useCategoriesStore.ts
@@ -130,7 +130,9 @@ export const useCategoriesStore = defineStore('categories', (): CategoriesStore
// Filter valid categories and pick top N by most recent usage
// @ts-expect-error Iterator Helpers not yet typed for MapIterator in TS 5.9
- const recentIds = latestDateByCategory.entries().toSorted(([, dateA], [, dateB]) => dateB - dateA).reduce<CategoryId[]>((acc, [categoryId]) => {
+ const sortedEntries: [CategoryId, number][] = latestDateByCategory.entries().toSorted(([, dateA], [, dateB]) => dateB - dateA)
+
+ const recentIds = sortedEntries.reduce<CategoryId[]>((acc, [categoryId]) => {
if (acc.length >= maxCategories)
return acc
diff --git a/app/components/trnForm/main/ActionSide.vue b/app/components/trnForm/main/ActionSide.vue
index 79894278..beefcb8f 100644
--- a/app/components/trnForm/main/ActionSide.vue
+++ b/app/components/trnForm/main/ActionSide.vue
@@ -6,6 +6,7 @@ import { useTrnsStore } from '~/components/trns/useTrnsStore'
const trnsStore = useTrnsStore()
const trnsFormStore = useTrnsFormStore()
+// @ts-expect-error `interval` not optional in VueUse types but has @default 0 — type bug
const { isSupported: isVibrateSupported, vibrate } = useVibrate({ pattern: [50, 50, 50] })
const isMath = computed(() => trnsFormStore.shouldShowSum())