fix: use native haptic plugin and remove semicolons

This commit is contained in:
benonymity
2022-12-08 19:09:46 -05:00
parent 1aa6a441f3
commit acc5bde33a
16 changed files with 65 additions and 87 deletions
+1 -3
View File
@@ -23,8 +23,6 @@
</template>
<script>
import { Haptics, ImpactStyle } from '@capacitor/haptics';
export default {
asyncData({ redirect, store }) {
if (!store.state.socketConnected) {
@@ -55,7 +53,7 @@ export default {
},
methods: {
async logout() {
await Haptics.impact({ style: ImpactStyle.Medium });
await this.$hapticsImpactMedium()
if (this.user) {
await this.$axios.$post('/logout').catch((error) => {
console.error(error)
+4 -5
View File
@@ -142,7 +142,6 @@
<script>
import { Dialog } from '@capacitor/dialog'
import { AbsFileSystem, AbsDownloader } from '@/plugins/capacitor'
import { Haptics, ImpactStyle } from '@capacitor/haptics';
export default {
@@ -410,7 +409,7 @@ export default {
},
async playClick() {
var episodeId = null
await Haptics.impact({ style: ImpactStyle.Medium });
await this.$hapticsImpactMedium()
if (this.isPodcast) {
this.episodes.sort((a, b) => {
@@ -464,7 +463,7 @@ export default {
this.$eventBus.$emit('play-item', { libraryItemId: this.libraryItemId, episodeId })
},
async clearProgressClick() {
await Haptics.impact({ style: ImpactStyle.Medium });
await this.$hapticsImpactMedium()
const { value } = await Dialog.confirm({
title: 'Confirm',
message: 'Are you sure you want to reset your progress?'
@@ -517,7 +516,7 @@ export default {
if (!this.numTracks) {
return
}
await Haptics.impact({ style: ImpactStyle.Medium });
await this.$hapticsImpactMedium()
if (this.isIos) {
// no local folders on iOS
this.startDownload()
@@ -585,7 +584,7 @@ export default {
}
},
async toggleFinished() {
await Haptics.impact({ style: ImpactStyle.Medium });
await this.$hapticsImpactMedium()
this.isProcessingReadUpdate = true
if (this.isLocal) {
var isFinished = !this.userIsFinished
+2 -3
View File
@@ -105,7 +105,6 @@ 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: {
@@ -257,7 +256,7 @@ export default {
this.showDialog = true
},
async play() {
await Haptics.impact({ style: ImpactStyle.Medium });
await this.$hapticsImpactMedium()
this.$eventBus.$emit('play-item', { libraryItemId: this.localLibraryItemId })
},
getCapImageSrc(contentUrl) {
@@ -265,7 +264,7 @@ export default {
},
async dialogAction(action) {
console.log('Dialog action', action)
await Haptics.impact({ style: ImpactStyle.Medium });
await this.$hapticsImpactMedium()
if (action == 'scan') {
this.scanItem()
} else if (action == 'rescan') {