This commit is contained in:
syuilo 2025-09-01 16:51:58 +09:00
parent 3566bc207f
commit 2ccf4f94cb
1 changed files with 4 additions and 4 deletions

View File

@ -24,8 +24,8 @@ SPDX-License-Identifier: AGPL-3.0-only
import { defineAsyncComponent, inject, onMounted, watch, ref } from 'vue';
import * as Misskey from 'misskey-js';
import { genId } from '@/utility/id.js';
import XContainer from '../page-editor.container.vue';
import { genId } from '@/utility/id.js';
import * as os from '@/os.js';
import { i18n } from '@/i18n.js';
import { deepClone } from '@/utility/clone.js';
@ -35,11 +35,11 @@ import { getPageBlockList } from '@/pages/page-editor/common.js';
const XBlocks = defineAsyncComponent(() => import('../page-editor.blocks.vue'));
const props = defineProps<{
modelValue: Misskey.entities.PageBlock & { type: 'section'; },
modelValue: Extract<Misskey.entities.PageBlock, { type: 'section'; }>,
}>();
const emit = defineEmits<{
(ev: 'update:modelValue', value: Misskey.entities.PageBlock & { type: 'section' }): void;
(ev: 'update:modelValue', value: Extract<Misskey.entities.PageBlock, { type: 'section'; }>): void;
(ev: 'remove'): void;
}>();
@ -59,7 +59,7 @@ async function rename() {
title: i18n.ts._pages.enterSectionTitle,
default: props.modelValue.title,
});
if (canceled) return;
if (canceled || title == null) return;
emit('update:modelValue', {
...props.modelValue,
title,