mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-21 16:38: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 [showEphemeralBackdrop, setShowEphemeralBackdrop] = useState(!!magnifiedNodeId);
|
||||
|
||||
const debouncedCallback = useCallback(
|
||||
debounce(100, (callback: () => void) => callback()),
|
||||
const debouncedSetMagnifyBackdrop = useCallback(
|
||||
debounce(100, () => setShowMagnifiedBackdrop(true)),
|
||||
[]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (magnifiedNodeId && !showMagnifiedBackdrop) {
|
||||
debouncedCallback(() => setShowMagnifiedBackdrop(true));
|
||||
debouncedSetMagnifyBackdrop();
|
||||
}
|
||||
if (!magnifiedNodeId) {
|
||||
setShowMagnifiedBackdrop(false);
|
||||
}
|
||||
if (ephemeralNode && !showEphemeralBackdrop) {
|
||||
debouncedCallback(() => setShowEphemeralBackdrop(true));
|
||||
setShowEphemeralBackdrop(true);
|
||||
}
|
||||
if (!ephemeralNode) {
|
||||
setShowEphemeralBackdrop(false);
|
||||
|
Loading…
Reference in New Issue
Block a user