pause when leaving the record page

This commit is contained in:
Julien Calixte
2023-04-19 23:58:51 +02:00
parent bb6c425f32
commit 53dc25514a

View File

@@ -3,7 +3,7 @@ import { useTaskStore } from '@/modules/task/stores/useTask.store'
import { toISODate } from '@/shared/types/date'
import { useActiveElement, useMagicKeys, whenever } from '@vueuse/core'
import { logicAnd } from '@vueuse/math'
import { computed } from 'vue'
import { computed, onUnmounted } from 'vue'
import { useTaskRecordStore } from '../stores/useTaskRecordStore'
const props = defineProps<{
@@ -86,6 +86,10 @@ whenever(logicAnd(notUsingInput, n), () => {
whenever(logicAnd(notUsingInput, s), () => {
startRecording()
})
onUnmounted(() => {
recordStore.pause(props.taskId)
})
</script>
<template>