mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-22 16:48:23 +01:00
Remove the debounce when setting the backdrop for the ephemeral nodes (#1280)
I added this debounce to delay the blurring of the background nodes when a node was magnified to account for the animation, but it looks weird for the ephemeral nodes since there's no animation when first showing them. When we work on node creation animations maybe I'll add back this delay
This commit is contained in:
parent
b429e967e6
commit
14249b33b2
@ -139,20 +139,20 @@ function NodeBackdrops({ layoutModel }: { layoutModel: LayoutModel }) {
|
|||||||
const [showMagnifiedBackdrop, setShowMagnifiedBackdrop] = useState(!!ephemeralNode);
|
const [showMagnifiedBackdrop, setShowMagnifiedBackdrop] = useState(!!ephemeralNode);
|
||||||
const [showEphemeralBackdrop, setShowEphemeralBackdrop] = useState(!!magnifiedNodeId);
|
const [showEphemeralBackdrop, setShowEphemeralBackdrop] = useState(!!magnifiedNodeId);
|
||||||
|
|
||||||
const debouncedCallback = useCallback(
|
const debouncedSetMagnifyBackdrop = useCallback(
|
||||||
debounce(100, (callback: () => void) => callback()),
|
debounce(100, () => setShowMagnifiedBackdrop(true)),
|
||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (magnifiedNodeId && !showMagnifiedBackdrop) {
|
if (magnifiedNodeId && !showMagnifiedBackdrop) {
|
||||||
debouncedCallback(() => setShowMagnifiedBackdrop(true));
|
debouncedSetMagnifyBackdrop();
|
||||||
}
|
}
|
||||||
if (!magnifiedNodeId) {
|
if (!magnifiedNodeId) {
|
||||||
setShowMagnifiedBackdrop(false);
|
setShowMagnifiedBackdrop(false);
|
||||||
}
|
}
|
||||||
if (ephemeralNode && !showEphemeralBackdrop) {
|
if (ephemeralNode && !showEphemeralBackdrop) {
|
||||||
debouncedCallback(() => setShowEphemeralBackdrop(true));
|
setShowEphemeralBackdrop(true);
|
||||||
}
|
}
|
||||||
if (!ephemeralNode) {
|
if (!ephemeralNode) {
|
||||||
setShowEphemeralBackdrop(false);
|
setShowEphemeralBackdrop(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user