fix(task): clear timeout for description save when closing the task detail
This commit is contained in:
parent
9f89fbe5a6
commit
8f85af07ca
@ -37,7 +37,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<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 CustomTransition from '@/components/misc/CustomTransition.vue'
|
||||||
import Editor from '@/components/input/AsyncEditor'
|
import Editor from '@/components/input/AsyncEditor'
|
||||||
@ -88,6 +88,12 @@ async function saveWithDelay() {
|
|||||||
}, 5000)
|
}, 5000)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
if (changeTimeout.value !== null) {
|
||||||
|
clearTimeout(changeTimeout.value)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
async function save() {
|
async function save() {
|
||||||
if (changeTimeout.value !== null) {
|
if (changeTimeout.value !== null) {
|
||||||
clearTimeout(changeTimeout.value)
|
clearTimeout(changeTimeout.value)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user