Merge pull request #459 from benonymity/hapticFeedback

Add haptic feedback
This commit is contained in:
advplyr
2022-12-09 17:08:17 -06:00
committed by GitHub
17 changed files with 113 additions and 65 deletions
+2 -1
View File
@@ -53,6 +53,7 @@ export default {
},
methods: {
async logout() {
await this.$hapticsImpactMedium()
if (this.user) {
await this.$axios.$post('/logout').catch((error) => {
console.error(error)
@@ -68,4 +69,4 @@ export default {
},
mounted() {}
}
</script>
</script>
+8 -3
View File
@@ -143,6 +143,7 @@
import { Dialog } from '@capacitor/dialog'
import { AbsFileSystem, AbsDownloader } from '@/plugins/capacitor'
export default {
async asyncData({ store, params, redirect, app }) {
var libraryItemId = params.id
@@ -406,8 +407,9 @@ export default {
readBook() {
this.$store.commit('openReader', this.libraryItem)
},
playClick() {
async playClick() {
var episodeId = null
await this.$hapticsImpactMedium()
if (this.isPodcast) {
this.episodes.sort((a, b) => {
@@ -461,6 +463,7 @@ export default {
this.$eventBus.$emit('play-item', { libraryItemId: this.libraryItemId, episodeId })
},
async clearProgressClick() {
await this.$hapticsImpactMedium()
const { value } = await Dialog.confirm({
title: 'Confirm',
message: 'Are you sure you want to reset your progress?'
@@ -506,13 +509,14 @@ export default {
this.showSelectLocalFolder = false
this.download(localFolder)
},
downloadClick() {
async downloadClick() {
if (this.downloadItem) {
return
}
if (!this.numTracks) {
return
}
await this.$hapticsImpactMedium()
if (this.isIos) {
// no local folders on iOS
this.startDownload()
@@ -580,6 +584,7 @@ export default {
}
},
async toggleFinished() {
await this.$hapticsImpactMedium()
this.isProcessingReadUpdate = true
if (this.isLocal) {
var isFinished = !this.userIsFinished
@@ -647,4 +652,4 @@ export default {
width: calc(100% - 64px);
max-width: calc(100% - 64px);
}
</style>
</style>
+5 -3
View File
@@ -255,14 +255,16 @@ export default {
}
this.showDialog = true
},
play() {
async play() {
await this.$hapticsImpactMedium()
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 this.$hapticsImpactMedium()
if (action == 'scan') {
this.scanItem()
} else if (action == 'rescan') {
@@ -405,4 +407,4 @@ export default {
.dragtrack-leave-active {
position: absolute;
}
</style>
</style>
+2 -1
View File
@@ -149,6 +149,7 @@ export default {
this.saveSettings()
},
async saveSettings() {
await this.$hapticsImpactMedium()
const updatedDeviceData = await this.$db.updateDeviceSettings({ ...this.settings })
console.log('Saved device data', updatedDeviceData)
if (updatedDeviceData) {
@@ -176,4 +177,4 @@ export default {
this.init()
}
}
</script>
</script>