From 560739627ad4f48dd6de861e990ea99aaf42b080 Mon Sep 17 00:00:00 2001 From: Untone Date: Sat, 17 Feb 2024 18:13:54 +0300 Subject: [PATCH] more-defined --- src/components/Views/EditView/EditView.tsx | 4 ++-- src/components/Views/PublishSettings/PublishSettings.tsx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/Views/EditView/EditView.tsx b/src/components/Views/EditView/EditView.tsx index 4e862696..1969e338 100644 --- a/src/components/Views/EditView/EditView.tsx +++ b/src/components/Views/EditView/EditView.tsx @@ -307,10 +307,10 @@ export const EditView = (props: Props) => { subtitleInput.current = el }} allowEnterKey={false} - value={(value) => setForm('subtitle', value)} + value={(value) => setForm('subtitle', value || '')} class={styles.subtitleInput} placeholder={t('Subheader')} - initialValue={form.subtitle} + initialValue={form.subtitle || ''} maxLength={MAX_HEADER_LIMIT} /> diff --git a/src/components/Views/PublishSettings/PublishSettings.tsx b/src/components/Views/PublishSettings/PublishSettings.tsx index 78dcdfbe..47a2dee4 100644 --- a/src/components/Views/PublishSettings/PublishSettings.tsx +++ b/src/components/Views/PublishSettings/PublishSettings.tsx @@ -100,7 +100,7 @@ export const PublishSettings = (props: Props) => { const handleTopicSelectChange = (newSelectedTopics) => { if ( props.form.selectedTopics.length === 0 || - newSelectedTopics.every((topic) => topic.id !== props.form.mainTopic.id) + newSelectedTopics.every((topic) => topic.id !== props.form.mainTopic?.id) ) { setSettingsForm((prev) => { return { @@ -176,7 +176,7 @@ export const PublishSettings = (props: Props) => {
{settingsForm.mainTopic.title}
{settingsForm.title}
-
{settingsForm.subtitle}
+
{settingsForm.subtitle || ''}
{author()?.name}
@@ -203,7 +203,7 @@ export const PublishSettings = (props: Props) => { variant="bordered" fieldName={t('Subheader')} placeholder={t('Come up with a subtitle for your story')} - initialValue={settingsForm.subtitle} + initialValue={settingsForm.subtitle || ''} value={(value) => setSettingsForm('subtitle', value)} allowEnterKey={false} maxLength={100}