Skip to content

Open source personal finance application

feat: add haptic vibration feedback on transaction submit

Ilya Komichevd5933035795d
diff --git a/app/components/trnForm/main/ActionSide.vue b/app/components/trnForm/main/ActionSide.vue
index ac44627f..79894278 100644
--- a/app/components/trnForm/main/ActionSide.vue
+++ b/app/components/trnForm/main/ActionSide.vue
@@ -1,9 +1,12 @@
<script setup lang="ts">
+import { useVibrate } from '@vueuse/core'
+
import { useTrnsFormStore } from '~/components/trnForm/useTrnsFormStore'
import { useTrnsStore } from '~/components/trns/useTrnsStore'
const trnsStore = useTrnsStore()
const trnsFormStore = useTrnsFormStore()
+const { isSupported: isVibrateSupported, vibrate } = useVibrate({ pattern: [50, 50, 50] })
const isMath = computed(() => trnsFormStore.shouldShowSum())
const isSubmittable = computed(() => trnsFormStore.values.amount[trnsFormStore.activeAmountIdx] > 0)
@@ -22,6 +25,10 @@ async function onClickSubmit() {
id: trnFormData.id,
values: trnFormData.values,
})
+
+ if (isVibrateSupported.value)
+ vibrate()
+
trnsFormStore.onClear()
}
</script>
diff --git a/package.json b/package.json
index 42472c6f..eed7022a 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "@ilkome/finapp",
"type": "module",
- "version": "7.0.0-beta.5",
+ "version": "7.0.0-beta.6",
"packageManager": "[email protected]",
"description": "Finapp helps you easily track and manage personal finances.",
"author": "Ilya Komichev @ilkome",