Hotfix/settings fix (#223)

* Move onCleanup inside onMount
This commit is contained in:
Ilya Y 2023-09-16 19:32:29 +03:00 committed by GitHub
parent a44e6455c0
commit 141ab3d0ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 10 deletions

View File

@ -217,11 +217,10 @@ const SimplifiedEditor = (props: Props) => {
onMount(() => { onMount(() => {
window.addEventListener('keydown', handleKeyDown) window.addEventListener('keydown', handleKeyDown)
}) onCleanup(() => {
window.removeEventListener('keydown', handleKeyDown)
onCleanup(() => { editor()?.destroy()
window.removeEventListener('keydown', handleKeyDown) })
editor().destroy()
}) })
if (props.onChange) { if (props.onChange) {

View File

@ -114,10 +114,9 @@ export const TextBubbleMenu = (props: BubbleMenuProps) => {
onMount(() => { onMount(() => {
window.addEventListener('keydown', handleKeyDown) window.addEventListener('keydown', handleKeyDown)
}) onCleanup(() => {
window.removeEventListener('keydown', handleKeyDown)
onCleanup(() => { })
window.removeEventListener('keydown', handleKeyDown)
}) })
return ( return (

View File

@ -187,7 +187,6 @@ export const ProfileSettingsPage = () => {
label={t('About myself')} label={t('About myself')}
initialContent={form.about} initialContent={form.about}
onChange={(value) => updateFormField('about', value)} onChange={(value) => updateFormField('about', value)}
maxLength={500}
/> />
{/*Нет реализации полей на бэке*/} {/*Нет реализации полей на бэке*/}
{/*<h4>{t('How can I help/skills')}</h4>*/} {/*<h4>{t('How can I help/skills')}</h4>*/}