fix(tasks): play pop sound directly and not from store
This solves two problems: 1. Previously, changing anything on a done task would play the pop sound all the time, because the store only knew the new done status was "done" and not if it was done previously already. 2. Safari will prevent playing a sound without user interaction. This means the user has to interact directly with the method playing the sound which was not the case when the sound was played from the store. Resolves https://kolaente.dev/vikunja/frontend/issues/3292
This commit is contained in:
@ -151,6 +151,8 @@ import {useBaseStore} from '@/stores/base'
|
||||
import {useTaskStore} from '@/stores/tasks'
|
||||
import AssigneeList from '@/components/tasks/partials/assigneeList.vue'
|
||||
import {useIntervalFn} from '@vueuse/core'
|
||||
import {playPopSound} from '@/helpers/playPop'
|
||||
import {useAuthStore} from '@/stores/auth'
|
||||
|
||||
const {
|
||||
theTask,
|
||||
@ -232,6 +234,9 @@ async function markAsDone(checked: boolean) {
|
||||
const updateFunc = async () => {
|
||||
const newTask = await taskStore.update(task.value)
|
||||
task.value = newTask
|
||||
if (checked && useAuthStore().settings.frontendSettings.playSoundWhenDone) {
|
||||
playPopSound()
|
||||
}
|
||||
emit('task-updated', newTask)
|
||||
success({
|
||||
message: task.value.done ?
|
||||
|
Reference in New Issue
Block a user