1
0

chore: debug

This commit is contained in:
kolaente
2023-12-01 11:29:35 +01:00
parent e27d88785e
commit 3cb1e7dede
2 changed files with 56 additions and 22 deletions

View File

@ -26,13 +26,12 @@
v-model="description"
@update:model-value="saveWithDelay"
@save="save"
:initial-mode="isEditorContentEmpty(description) ? 'edit' : 'preview'"
/>
</div>
</template>
<script setup lang="ts">
import {ref, computed, watch} from 'vue'
import {ref, computed, watch, nextTick} from 'vue'
import CustomTransition from '@/components/misc/CustomTransition.vue'
import Editor from '@/components/input/AsyncEditor'
@ -64,10 +63,15 @@ const saving = ref(false)
const taskStore = useTaskStore()
const loading = computed(() => taskStore.isLoading)
const editorMode = ref('preview')
watch(
() => modelValue.description,
value => {
description.value = value
nextTick(() => {
editorMode.value = isEditorContentEmpty(value) ? 'edit' : 'preview'
})
},
{immediate: true},
)