diff --git a/components/app/AudioPlayer.vue b/components/app/AudioPlayer.vue
index 7ae2d5c3..01f84268 100644
--- a/components/app/AudioPlayer.vue
+++ b/components/app/AudioPlayer.vue
@@ -335,15 +335,18 @@ export default {
this.showFullscreen = false
}
},
- touchstartTrack(e) {
+ async touchstartTrack(e) {
+ await this.$hapticsImpactMedium()
if (!e || !e.touches || !this.$refs.track || !this.showFullscreen || this.lockUi) return
this.touchTrackStart = true
},
- selectChapter(chapter) {
+ async selectChapter(chapter) {
+ await this.$hapticsImpactMedium()
this.seek(chapter.start)
this.showChapterModal = false
},
- castClick() {
+ async castClick() {
+ await this.$hapticsImpactMedium()
if (this.isLocalPlayMethod) {
this.$eventBus.$emit('cast-local-item')
return
@@ -362,12 +365,14 @@ export default {
this.showFullscreen = false
this.forceCloseDropdownMenu()
},
- jumpNextChapter() {
+ async jumpNextChapter() {
+ await this.$hapticsImpactMedium()
if (this.isLoading) return
if (!this.nextChapter) return
this.seek(this.nextChapter.start)
},
- jumpChapterStart() {
+ async jumpChapterStart() {
+ await this.$hapticsImpactMedium()
if (this.isLoading) return
if (!this.currentChapter) {
return this.restart()
@@ -387,7 +392,8 @@ export default {
showSleepTimerModal() {
this.$emit('showSleepTimer')
},
- setPlaybackSpeed(speed) {
+ async setPlaybackSpeed(speed) {
+ await this.$hapticsImpactMedium()
console.log(`[AudioPlayer] Set Playback Rate: ${speed}`)
this.currentPlaybackRate = speed
AbsAudioPlayer.setPlaybackSpeed({ value: speed })
@@ -395,11 +401,13 @@ export default {
restart() {
this.seek(0)
},
- jumpBackwards() {
+ async jumpBackwards() {
+ await this.$hapticsImpactMedium()
if (this.isLoading) return
AbsAudioPlayer.seekBackward({ value: this.jumpBackwardsTime })
},
- jumpForward() {
+ async jumpForward() {
+ await this.$hapticsImpactMedium()
if (this.isLoading) return
AbsAudioPlayer.seekForward({ value: this.jumpForwardTime })
},
@@ -539,6 +547,7 @@ export default {
this.seek(time)
},
async playPauseClick() {
+ await this.$hapticsImpactMedium()
if (this.isLoading) return
this.isPlaying = !!((await AbsAudioPlayer.playPause()) || {}).playing
@@ -641,7 +650,8 @@ export default {
ts.innerText = currTimeStr
}
},
- clickMenuAction(action) {
+ async clickMenuAction(action) {
+ await this.$hapticsImpactMedium()
this.showMoreMenuDialog = false
this.$nextTick(() => {
if (action === 'lock') {
@@ -969,4 +979,4 @@ export default {
.fullscreen #playerControls .play-btn .material-icons {
font-size: 2.1rem;
}
-
\ No newline at end of file
+
diff --git a/components/app/SideDrawer.vue b/components/app/SideDrawer.vue
index fec146db..152dcf95 100644
--- a/components/app/SideDrawer.vue
+++ b/components/app/SideDrawer.vue
@@ -137,6 +137,7 @@ export default {
this.show = false
},
async logout() {
+ await this.$hapticsImpactMedium()
if (this.user) {
await this.$axios.$post('/logout').catch((error) => {
console.error(error)
diff --git a/components/cards/LazyBookCard.vue b/components/cards/LazyBookCard.vue
index 899d80f2..5d4090ca 100644
--- a/components/cards/LazyBookCard.vue
+++ b/components/cards/LazyBookCard.vue
@@ -401,12 +401,13 @@ export default {
// Server books may have a local library item
this.localLibraryItem = localLibraryItem
},
- clickCard(e) {
+ async clickCard(e) {
if (this.isSelectionMode) {
e.stopPropagation()
e.preventDefault()
this.selectBtnClick()
} else if (this.recentEpisode) {
+ await this.$hapticsImpactMedium()
var eventBus = this.$eventBus || this.$nuxt.$eventBus
if (this.streamIsPlaying) {
eventBus.$emit('pause-item')
diff --git a/components/connection/ServerConnectForm.vue b/components/connection/ServerConnectForm.vue
index 047a37cc..ad220a7f 100644
--- a/components/connection/ServerConnectForm.vue
+++ b/components/connection/ServerConnectForm.vue
@@ -132,6 +132,7 @@ export default {
}
},
async connectToServer(config) {
+ await this.$hapticsImpactMedium()
console.log('[ServerConnectForm] connectToServer', config.address)
this.processing = true
this.serverConfig = {
@@ -159,6 +160,7 @@ export default {
},
async removeServerConfigClick() {
if (!this.serverConfig.id) return
+ await this.$hapticsImpactMedium()
const { value } = await Dialog.confirm({
title: 'Confirm',
@@ -189,7 +191,8 @@ export default {
this.showForm = true
this.showAuth = true
},
- newServerConfigClick() {
+ async newServerConfigClick() {
+ await this.$hapticsImpactMedium()
this.serverConfig = {
address: '',
userId: '',
@@ -348,4 +351,4 @@ export default {
this.init()
}
}
-
\ No newline at end of file
+
diff --git a/components/home/BookshelfToolbar.vue b/components/home/BookshelfToolbar.vue
index 2acf0037..45b8ec0d 100644
--- a/components/home/BookshelfToolbar.vue
+++ b/components/home/BookshelfToolbar.vue
@@ -8,7 +8,7 @@
{{ totalEntities }} {{ entityTitle }}
{{ selectedSeriesName }} ({{ totalEntities }})
- {{ !bookshelfListView ? 'view_list' : 'grid_view' }}
+ {{ !bookshelfListView ? 'view_list' : 'grid_view' }}
filter_alt
@@ -102,6 +102,10 @@ export default {
},
setTotalEntities(total) {
this.totalEntities = total
+ },
+ async changeView() {
+ this.bookshelfListView = !this.bookshelfListView
+ await this.$hapticsImpactMedium()
}
},
mounted() {
@@ -120,4 +124,4 @@ export default {
#bookshelf-toolbar {
box-shadow: 0px 5px 5px #11111155;
}
-
\ No newline at end of file
+
diff --git a/components/modals/BookmarksModal.vue b/components/modals/BookmarksModal.vue
index 1fb12459..19f7a891 100644
--- a/components/modals/BookmarksModal.vue
+++ b/components/modals/BookmarksModal.vue
@@ -46,6 +46,7 @@
\ No newline at end of file
+
diff --git a/components/modals/SleepTimerModal.vue b/components/modals/SleepTimerModal.vue
index a4e5a887..90f2e325 100644
--- a/components/modals/SleepTimerModal.vue
+++ b/components/modals/SleepTimerModal.vue
@@ -89,30 +89,37 @@ export default {
}
},
methods: {
- clickedChapterOption() {
+ async clickedChapterOption() {
+ await this.$hapticsImpactMedium()
this.show = false
this.$nextTick(() => this.$emit('change', { time: this.currentEndOfChapterTime * 1000, isChapterTime: true }))
},
- clickedOption(timeoutMin) {
+ async clickedOption(timeoutMin) {
+ await this.$hapticsImpactMedium()
var timeout = timeoutMin * 1000 * 60
this.show = false
this.manualTimerModal = false
this.$nextTick(() => this.$emit('change', { time: timeout, isChapterTime: false }))
},
- cancelSleepTimer() {
+ async cancelSleepTimer() {
+ await this.$hapticsImpactMedium()
this.$emit('cancel')
this.show = false
},
- increaseSleepTime() {
+ async increaseSleepTime() {
+ await this.$hapticsImpactMedium()
this.$emit('increase')
},
- decreaseSleepTime() {
+ async decreaseSleepTime() {
+ await this.$hapticsImpactMedium()
this.$emit('decrease')
},
- increaseManualTimeout() {
+ async increaseManualTimeout() {
+ await this.$hapticsImpactMedium()
this.manualTimeoutMin++
},
- decreaseManualTimeout() {
+ async decreaseManualTimeout() {
+ await this.$hapticsImpactMedium()
if (this.manualTimeoutMin > 1) this.manualTimeoutMin--
}
},
diff --git a/components/modals/playlists/AddCreateModal.vue b/components/modals/playlists/AddCreateModal.vue
index 33abb375..25cf827e 100644
--- a/components/modals/playlists/AddCreateModal.vue
+++ b/components/modals/playlists/AddCreateModal.vue
@@ -114,7 +114,8 @@ export default {
this.loading = false
})
},
- clickPlaylist(playlist) {
+ async clickPlaylist(playlist) {
+ await this.$hapticsImpactMedium()
if (playlist.isItemIncluded) {
this.removeFromPlaylist(playlist)
} else {
@@ -163,7 +164,8 @@ export default {
this.newPlaylistName = ''
this.showPlaylistNameInput = true
},
- submitCreatePlaylist() {
+ async submitCreatePlaylist() {
+ await this.$hapticsImpactMedium()
if (!this.newPlaylistName || !this.selectedPlaylistItems.length) {
return
}
diff --git a/components/tables/podcast/EpisodeRow.vue b/components/tables/podcast/EpisodeRow.vue
index 5bc3fee7..45eb8987 100644
--- a/components/tables/podcast/EpisodeRow.vue
+++ b/components/tables/podcast/EpisodeRow.vue
@@ -148,8 +148,9 @@ export default {
}
return folderObj
},
- downloadClick() {
+ async downloadClick() {
if (this.downloadItem) return
+ await this.$hapticsImpactMedium()
if (this.isIos) {
// no local folders on iOS
this.startDownload()
@@ -209,7 +210,8 @@ export default {
this.$toast.error(errorMsg)
}
},
- playClick() {
+ async playClick() {
+ await this.$hapticsImpactMedium()
if (this.streamIsPlaying) {
this.$eventBus.$emit('pause-item')
} else {
@@ -231,6 +233,7 @@ export default {
}
},
async toggleFinished() {
+ await this.$hapticsImpactMedium()
this.isProcessingReadUpdate = true
if (this.isLocal || this.localEpisode) {
var isFinished = !this.userIsFinished
@@ -278,4 +281,4 @@ export default {
}
}
}
-
\ No newline at end of file
+
diff --git a/pages/account.vue b/pages/account.vue
index 245e43a0..27fb5ff6 100644
--- a/pages/account.vue
+++ b/pages/account.vue
@@ -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() {}
}
-
\ No newline at end of file
+
diff --git a/pages/item/_id.vue b/pages/item/_id.vue
index de4115c5..a14468f8 100644
--- a/pages/item/_id.vue
+++ b/pages/item/_id.vue
@@ -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);
}
-
\ No newline at end of file
+
diff --git a/pages/localMedia/item/_id.vue b/pages/localMedia/item/_id.vue
index 21c4a7c7..72cb0f57 100644
--- a/pages/localMedia/item/_id.vue
+++ b/pages/localMedia/item/_id.vue
@@ -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;
}
-
\ No newline at end of file
+
diff --git a/pages/settings.vue b/pages/settings.vue
index 8d4510cf..1787acdc 100644
--- a/pages/settings.vue
+++ b/pages/settings.vue
@@ -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()
}
}
-
\ No newline at end of file
+
diff --git a/plugins/haptics.js b/plugins/haptics.js
index c60cb4e3..5000e277 100644
--- a/plugins/haptics.js
+++ b/plugins/haptics.js
@@ -1,52 +1,52 @@
-import Vue from 'vue'
-import { Haptics, ImpactStyle, NotificationType } from '@capacitor/haptics'
+import Vue from "vue";
+import { Haptics, ImpactStyle, NotificationType } from "@capacitor/haptics"
const hapticsImpactHeavy = async () => {
- await Haptics.impact({ style: ImpactStyle.Heavy });
+ await Haptics.impact({ style: ImpactStyle.Heavy })
}
-Vue.prototype.$hapticsImpactHeavy = hapticsImpactHeavy
+Vue.prototype.$hapticsImpactHeavy = hapticsImpactHeavy;
const hapticsImpactMedium = async () => {
- await Haptics.impact({ style: ImpactStyle.Medium });
+ await Haptics.impact({ style: ImpactStyle.Medium })
}
Vue.prototype.$hapticsImpactMedium = hapticsImpactMedium
const hapticsImpactLight = async () => {
- await Haptics.impact({ style: ImpactStyle.Light });
-};
+ await Haptics.impact({ style: ImpactStyle.Light })
+}
Vue.prototype.$hapticsImpactLight = hapticsImpactLight
const hapticsVibrate = async () => {
- await Haptics.vibrate();
-};
-Vue.prototype.$hapticsVibrate = hapticsVibrate
+ await Haptics.vibrate()
+}
+Vue.prototype.$hapticsVibrate = hapticsVibrate;
const hapticsNotificationSuccess = async () => {
- await Haptics.notification({ type: NotificationType.Success });
-};
+ await Haptics.notification({ type: NotificationType.Success })
+}
Vue.prototype.$hapticsNotificationSuccess = hapticsNotificationSuccess
const hapticsNotificationWarning = async () => {
- await Haptics.notification({ type: NotificationType.Warning });
-};
+ await Haptics.notification({ type: NotificationType.Warning })
+}
Vue.prototype.$hapticsNotificationWarning = hapticsNotificationWarning
const hapticsNotificationError = async () => {
- await Haptics.notification({ type: NotificationType.Error });
-};
+ await Haptics.notification({ type: NotificationType.Error })
+}
Vue.prototype.$hapticsNotificationError = hapticsNotificationError
const hapticsSelectionStart = async () => {
- await Haptics.selectionStart();
-};
+ await Haptics.selectionStart()
+}
Vue.prototype.$hapticsSelectionStart = hapticsSelectionStart
const hapticsSelectionChanged = async () => {
- await Haptics.selectionChanged();
-};
+ await Haptics.selectionChanged()
+}
Vue.prototype.$hapticsSelectionChanged = hapticsSelectionChanged
const hapticsSelectionEnd = async () => {
- await Haptics.selectionEnd();
-};
-Vue.prototype.$hapticsSelectionEnd = hapticsSelectionEnd
\ No newline at end of file
+ await Haptics.selectionEnd()
+}
+Vue.prototype.$hapticsSelectionEnd = hapticsSelectionEnd