fix: 🐛 fix prototype with async
This commit is contained in:
parent
81af0c219f
commit
7efb0327d4
@ -18,7 +18,7 @@ export const usePlayer = defineStore('player', {
|
||||
started: 0,
|
||||
}),
|
||||
actions: {
|
||||
init: () => {
|
||||
init() {
|
||||
audio.ondurationchange = () => (this.duration = audio.duration)
|
||||
audio.onended = () => this.stop()
|
||||
audio.onloadeddata = () => (this.loaded = true)
|
||||
@ -29,7 +29,7 @@ export const usePlayer = defineStore('player', {
|
||||
audio.ontimeupdate = () => (this.currentTime = audio.currentTime)
|
||||
audio.onvolumechange = () => (this.volume = audio.volume)
|
||||
},
|
||||
load: async (episode, podcastUrl) => {
|
||||
async load(episode, podcastUrl) {
|
||||
this.episode = episode
|
||||
this.podcastUrl = podcastUrl
|
||||
|
||||
@ -63,24 +63,24 @@ export const usePlayer = defineStore('player', {
|
||||
audio.src = ''
|
||||
}
|
||||
},
|
||||
pause: () => {
|
||||
pause() {
|
||||
audio.pause()
|
||||
this.paused = true
|
||||
},
|
||||
play: () => {
|
||||
play() {
|
||||
audio.play()
|
||||
this.paused = false
|
||||
this.started = audio.currentTime
|
||||
},
|
||||
seek: (currentTime) => {
|
||||
seek(currentTime) {
|
||||
audio.currentTime = currentTime
|
||||
this.time()
|
||||
},
|
||||
stop: () => {
|
||||
stop() {
|
||||
this.pause()
|
||||
this.episode = null
|
||||
},
|
||||
time: () => {
|
||||
time() {
|
||||
this.episode.action = {
|
||||
podcast: this.podcastUrl,
|
||||
episode: this.episode.url,
|
||||
@ -95,10 +95,10 @@ export const usePlayer = defineStore('player', {
|
||||
this.episode.action,
|
||||
])
|
||||
},
|
||||
setVolume: (volume) => {
|
||||
setVolume(volume) {
|
||||
audio.volume = volume
|
||||
},
|
||||
setRate: (rate) => {
|
||||
setRate(rate) {
|
||||
audio.playbackRate = rate
|
||||
},
|
||||
},
|
||||
|
@ -10,7 +10,7 @@ export const useSettings = defineStore('settings', {
|
||||
},
|
||||
}),
|
||||
actions: {
|
||||
setFilters: (filters) => {
|
||||
setFilters(filters) {
|
||||
this.filters = { ...this.filters, ...filters }
|
||||
setCookie('repod.filters', JSON.stringify(this.filters), 365)
|
||||
},
|
||||
|
@ -7,7 +7,7 @@ export const useSubscriptions = defineStore('subscriptions', {
|
||||
subscriptions: [],
|
||||
}),
|
||||
actions: {
|
||||
fetch: async () => {
|
||||
async fetch() {
|
||||
const metrics = await axios.get(
|
||||
generateUrl('/apps/gpoddersync/personal_settings/metrics'),
|
||||
)
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<AppContent class="main">
|
||||
<NcTextField :label="t('repod', 'Find a podcast')" v-model="search">
|
||||
<NcTextField v-model="search" :label="t('repod', 'Find a podcast')">
|
||||
<template #icon>
|
||||
<Magnify :size="20" />
|
||||
</template>
|
||||
|
Loading…
Reference in New Issue
Block a user