로딩 문구와 제목 보정
This commit is contained in:
@@ -125,13 +125,19 @@ const effectiveAuthorName = computed(() => {
|
||||
return (authorAccountName.value || '').trim() || 'unknown'
|
||||
})
|
||||
const autoGeneratedTitle = ref(createAutoTierListTitle())
|
||||
const effectiveTitle = computed(() => {
|
||||
const saveTitle = computed(() => {
|
||||
const customTitle = (title.value || '').trim()
|
||||
if (customTitle) return customTitle
|
||||
if (persistedTierListId.value) return persistedTierListId.value
|
||||
if (tierListId.value && tierListId.value !== 'new') return tierListId.value
|
||||
return autoGeneratedTitle.value
|
||||
})
|
||||
const displayTitle = computed(() => {
|
||||
const customTitle = (title.value || '').trim()
|
||||
if (customTitle) return customTitle
|
||||
const topicName = (templateName.value || '').trim()
|
||||
if (topicName) return `${topicName} 티어표`
|
||||
if (isEditorLoading.value) return ''
|
||||
return '제목 없는 티어표'
|
||||
})
|
||||
const displayThumbnailUrl = computed(() => thumbnailPreviewUrl.value || (thumbnailSrc.value ? resolveItemSrc({ src: thumbnailSrc.value }) : ''))
|
||||
const untitledWarning = computed(
|
||||
() =>
|
||||
@@ -916,7 +922,7 @@ async function downloadImage() {
|
||||
const url = URL.createObjectURL(blob)
|
||||
const a = document.createElement('a')
|
||||
a.href = url
|
||||
a.download = `${effectiveTitle.value.trim()}.png`
|
||||
a.download = `${(displayTitle.value || 'tier-maker').trim()}.png`
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
a.remove()
|
||||
@@ -980,7 +986,7 @@ async function uploadPendingThumbnail() {
|
||||
}
|
||||
|
||||
function buildPayload(existingId) {
|
||||
const finalTitle = effectiveTitle.value
|
||||
const finalTitle = saveTitle.value
|
||||
return {
|
||||
id: existingId || undefined,
|
||||
topicId: templateId.value,
|
||||
@@ -1267,6 +1273,7 @@ function resetEditorStateForRoute() {
|
||||
groups.value = normalizeLoadedGroups([], columns.value)
|
||||
pool.value = []
|
||||
itemsById.value = {}
|
||||
templateName.value = ''
|
||||
title.value = ''
|
||||
persistedTierListId.value = ''
|
||||
thumbnailSrc.value = ''
|
||||
@@ -1416,7 +1423,7 @@ watch(
|
||||
() => {
|
||||
loadEditorState()
|
||||
},
|
||||
{ immediate: true }
|
||||
{ immediate: true, flush: 'sync' }
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
Reference in New Issue
Block a user