pause when leaving the record page
This commit is contained in:
@@ -3,7 +3,7 @@ import { useTaskStore } from '@/modules/task/stores/useTask.store'
|
|||||||
import { toISODate } from '@/shared/types/date'
|
import { toISODate } from '@/shared/types/date'
|
||||||
import { useActiveElement, useMagicKeys, whenever } from '@vueuse/core'
|
import { useActiveElement, useMagicKeys, whenever } from '@vueuse/core'
|
||||||
import { logicAnd } from '@vueuse/math'
|
import { logicAnd } from '@vueuse/math'
|
||||||
import { computed } from 'vue'
|
import { computed, onUnmounted } from 'vue'
|
||||||
import { useTaskRecordStore } from '../stores/useTaskRecordStore'
|
import { useTaskRecordStore } from '../stores/useTaskRecordStore'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
@@ -86,6 +86,10 @@ whenever(logicAnd(notUsingInput, n), () => {
|
|||||||
whenever(logicAnd(notUsingInput, s), () => {
|
whenever(logicAnd(notUsingInput, s), () => {
|
||||||
startRecording()
|
startRecording()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
recordStore.pause(props.taskId)
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
Reference in New Issue
Block a user