fix(task): clear timeout for description save when closing the task detail

This commit is contained in:
kolaente 2024-03-20 11:26:54 +01:00
parent 9f89fbe5a6
commit 8f85af07ca
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 7 additions and 1 deletions

View File

@ -37,7 +37,7 @@
</template>
<script setup lang="ts">
import {ref, computed, watch} from 'vue'
import {ref, computed, watch, onBeforeUnmount} from 'vue'
import CustomTransition from '@/components/misc/CustomTransition.vue'
import Editor from '@/components/input/AsyncEditor'
@ -88,6 +88,12 @@ async function saveWithDelay() {
}, 5000)
}
onBeforeUnmount(() => {
if (changeTimeout.value !== null) {
clearTimeout(changeTimeout.value)
}
})
async function save() {
if (changeTimeout.value !== null) {
clearTimeout(changeTimeout.value)