From 7efb0327d4d431ea18d38885a35be1af58a1b21a Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Fri, 9 Aug 2024 22:51:32 +0200 Subject: [PATCH] fix: :bug: fix prototype with async --- src/store/player.js | 18 +++++++++--------- src/store/settings.js | 2 +- src/store/subscriptions.js | 2 +- src/views/Discover.vue | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/store/player.js b/src/store/player.js index 1bad73d..c769625 100644 --- a/src/store/player.js +++ b/src/store/player.js @@ -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 }, }, diff --git a/src/store/settings.js b/src/store/settings.js index b8ab82a..e463922 100644 --- a/src/store/settings.js +++ b/src/store/settings.js @@ -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) }, diff --git a/src/store/subscriptions.js b/src/store/subscriptions.js index 3d075d6..a2d7731 100644 --- a/src/store/subscriptions.js +++ b/src/store/subscriptions.js @@ -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'), ) diff --git a/src/views/Discover.vue b/src/views/Discover.vue index a569afb..4d9c899 100644 --- a/src/views/Discover.vue +++ b/src/views/Discover.vue @@ -1,6 +1,6 @@