Fix profile settings Is Floating PanelVisible

This commit is contained in:
ilya-bkv 2024-04-04 09:01:26 +03:00
parent b9591d7364
commit b752357224

View File

@ -1,7 +1,18 @@
import { createFileUploader } from '@solid-primitives/upload'
import { clsx } from 'clsx'
import deepEqual from 'fast-deep-equal'
import { For, Match, Show, Switch, createEffect, createSignal, lazy, onCleanup, onMount } from 'solid-js'
import {
For,
Match,
Show,
Switch,
createEffect,
createSignal,
lazy,
onCleanup,
onMount,
on
} from "solid-js";
import { createStore } from 'solid-js/store'
import { useConfirm } from '../../context/confirm'
@ -156,12 +167,15 @@ export const ProfileSettings = () => {
onCleanup(() => window.removeEventListener('beforeunload', handleBeforeUnload))
})
createEffect(() => {
if (!deepEqual(form, prevForm)) {
setIsFloatingPanelVisible(true)
}
})
createEffect(
on(
() => deepEqual(form, prevForm),
() => {
setIsFloatingPanelVisible(!deepEqual(form, prevForm))
},
{ defer: true }
),
)
const handleDeleteSocialLink = (link) => {
updateFormField('links', link, true)
}