feat: play pop sound from store
All checks were successful
continuous-integration/drone/pr Build is passing

This commit is contained in:
kolaente 2022-09-08 13:51:47 +02:00
parent 833cf056aa
commit f24ac01e36
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
5 changed files with 5 additions and 18 deletions

View File

@ -68,7 +68,6 @@
<script lang="ts">
import {defineComponent, type PropType} from 'vue'
import {playPop} from '../../../helpers/playPop'
import PriorityLabel from '../../../components/tasks/partials/priorityLabel.vue'
import User from '../../../components/misc/user.vue'
import Done from '@/components/misc/Done.vue'
@ -125,9 +124,6 @@ export default defineComponent({
...task,
done,
})
if (done) {
playPop()
}
} finally {
this.loadingInternal = false
}

View File

@ -154,7 +154,6 @@ import BaseButton from '@/components/base/BaseButton.vue'
import Multiselect from '@/components/input/multiselect.vue'
import Fancycheckbox from '@/components/input/fancycheckbox.vue'
import type {ITask} from '@/modelTypes/ITask'
import {playPop} from '@/helpers/playPop'
export default defineComponent({
name: 'relatedTasks',
@ -323,10 +322,6 @@ export default defineComponent({
},
async toggleTaskDone(task: ITask) {
if (task.done) {
playPop()
}
await this.$store.dispatch('tasks/update', task)
// Find the task in the list and update it so that it is correctly strike through

View File

@ -107,7 +107,6 @@ import BaseButton from '@/components/base/BaseButton.vue'
import Fancycheckbox from '../../input/fancycheckbox.vue'
import DeferTask from './defer-task.vue'
import {closeWhenClickedOutside} from '@/helpers/closeWhenClickedOutside'
import {playPop} from '@/helpers/playPop'
import ChecklistSummary from './checklist-summary.vue'
import {formatDateSince, formatISO, formatDateLong} from '@/helpers/time/formatDate'
@ -195,10 +194,7 @@ export default defineComponent({
async markAsDone(checked: boolean) {
const updateFunc = async () => {
const task = await this.taskService.update(this.task)
if (this.task.done) {
playPop()
}
const task = await this.$store.dispatch('tasks/update', this.task)
this.task = task
this.$emit('task-updated', task)
this.$message.success({

View File

@ -25,6 +25,7 @@ import type { IAttachment } from '@/modelTypes/IAttachment'
import type { IList } from '@/modelTypes/IList'
import type { RootStoreState, TaskState } from '@/store/types'
import {playPop} from '@/helpers/playPop'
// IDEA: maybe use a small fuzzy search here to prevent errors
function findPropertyByValue(object, key, value) {
@ -94,6 +95,9 @@ const tasksStore : Module<TaskState, RootStoreState>= {
try {
const updatedTask = await taskService.update(task)
ctx.commit('kanban/setTaskInBucket', updatedTask, {root: true})
if (task.done) {
playPop()
}
return updatedTask
} finally {
cancel()

View File

@ -446,7 +446,6 @@ import ColorPicker from '../../components/input/colorPicker.vue'
import heading from '@/components/tasks/partials/heading.vue'
import Datepicker from '@/components/input/datepicker.vue'
import BaseButton from '@/components/base/BaseButton.vue'
import {playPop} from '@/helpers/playPop'
import TaskSubscription from '@/components/misc/subscription.vue'
import {CURRENT_LIST} from '@/store/mutation-types'
@ -716,9 +715,6 @@ export default defineComponent({
...this.task,
done: !this.task.done,
}
if (newTask.done) {
playPop()
}
this.saveTask({
task: newTask,