From 141ab3d0ed2568599458d8ee1b0a827c07e6c3df Mon Sep 17 00:00:00 2001 From: Ilya Y <75578537+ilya-bkv@users.noreply.github.com> Date: Sat, 16 Sep 2023 19:32:29 +0300 Subject: [PATCH] Hotfix/settings fix (#223) * Move onCleanup inside onMount --- src/components/Editor/SimplifiedEditor.tsx | 9 ++++----- src/components/Editor/TextBubbleMenu/TextBubbleMenu.tsx | 7 +++---- src/pages/profile/profileSettings.page.tsx | 1 - 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/components/Editor/SimplifiedEditor.tsx b/src/components/Editor/SimplifiedEditor.tsx index 0cb86f4d..191125d9 100644 --- a/src/components/Editor/SimplifiedEditor.tsx +++ b/src/components/Editor/SimplifiedEditor.tsx @@ -217,11 +217,10 @@ const SimplifiedEditor = (props: Props) => { onMount(() => { window.addEventListener('keydown', handleKeyDown) - }) - - onCleanup(() => { - window.removeEventListener('keydown', handleKeyDown) - editor().destroy() + onCleanup(() => { + window.removeEventListener('keydown', handleKeyDown) + editor()?.destroy() + }) }) if (props.onChange) { diff --git a/src/components/Editor/TextBubbleMenu/TextBubbleMenu.tsx b/src/components/Editor/TextBubbleMenu/TextBubbleMenu.tsx index 052410ab..821f1897 100644 --- a/src/components/Editor/TextBubbleMenu/TextBubbleMenu.tsx +++ b/src/components/Editor/TextBubbleMenu/TextBubbleMenu.tsx @@ -114,10 +114,9 @@ export const TextBubbleMenu = (props: BubbleMenuProps) => { onMount(() => { window.addEventListener('keydown', handleKeyDown) - }) - - onCleanup(() => { - window.removeEventListener('keydown', handleKeyDown) + onCleanup(() => { + window.removeEventListener('keydown', handleKeyDown) + }) }) return ( diff --git a/src/pages/profile/profileSettings.page.tsx b/src/pages/profile/profileSettings.page.tsx index 192401a2..e9c67d1d 100644 --- a/src/pages/profile/profileSettings.page.tsx +++ b/src/pages/profile/profileSettings.page.tsx @@ -187,7 +187,6 @@ export const ProfileSettingsPage = () => { label={t('About myself')} initialContent={form.about} onChange={(value) => updateFormField('about', value)} - maxLength={500} /> {/*Нет реализации полей на бэке*/} {/*

{t('How can I help/skills')}

*/}