feat: add haptic feedback to all action buttons

This commit is contained in:
benonymity
2022-12-08 00:28:28 -05:00
parent 96dde8cf31
commit 1aa6a441f3
16 changed files with 113 additions and 42 deletions
+6 -3
View File
@@ -105,6 +105,7 @@ import draggable from 'vuedraggable'
import { Capacitor } from '@capacitor/core'
import { Dialog } from '@capacitor/dialog'
import { AbsFileSystem } from '@/plugins/capacitor'
import { Haptics, ImpactStyle } from '@capacitor/haptics';
export default {
components: {
@@ -255,14 +256,16 @@ export default {
}
this.showDialog = true
},
play() {
async play() {
await Haptics.impact({ style: ImpactStyle.Medium });
this.$eventBus.$emit('play-item', { libraryItemId: this.localLibraryItemId })
},
getCapImageSrc(contentUrl) {
return Capacitor.convertFileSrc(contentUrl)
},
dialogAction(action) {
async dialogAction(action) {
console.log('Dialog action', action)
await Haptics.impact({ style: ImpactStyle.Medium });
if (action == 'scan') {
this.scanItem()
} else if (action == 'rescan') {
@@ -405,4 +408,4 @@ export default {
.dragtrack-leave-active {
position: absolute;
}
</style>
</style>