Move AbsAudioPlayer.setChapterTrack to AudioPlayer instead of localStore

This commit is contained in:
advplyr 2024-01-01 08:22:20 -06:00
parent 73d70dd480
commit 322cad5548
2 changed files with 9 additions and 8 deletions

View file

@ -1,7 +1,4 @@
import { Preferences } from '@capacitor/preferences'
import { AbsAudioPlayer } from '@/plugins/capacitor'
import { Capacitor } from '@capacitor/core'
class LocalStorage {
constructor(vuexStore) {
@ -48,9 +45,6 @@ class LocalStorage {
async setUseChapterTrack(useChapterTrack) {
try {
await Preferences.set({ key: 'useChapterTrack', value: useChapterTrack ? '1' : '0' })
if (Capacitor.getPlatform() === 'ios') {
AbsAudioPlayer.setChapterTrack({ enabled: useChapterTrack })
}
} catch (error) {
console.error('[LocalStorage] Failed to set use chapter track', error)
}