Skip to content

Commit

Permalink
fix snaps ?
Browse files Browse the repository at this point in the history
  • Loading branch information
sirineJ committed Jan 7, 2025
1 parent 9e7f09e commit bb0d81a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ vi.mock('./SidePanel.js', () => ({
onAfterClose,
children,
}: { open: boolean; onAfterClose?: () => void; children: ReactNode }) => {
useEffect(() => () => {
useEffect(
() => () => {
onAfterClose?.();
}, [onAfterClose]);
},
[onAfterClose],
);

return <dialog open={open}>{children}</dialog>;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,6 @@ export const DesktopSidePanel = forwardRef<
return () => clearTimeout(timeoutId);
}, [open]);

useEffect(
() => () => {
if (dialogRef.current) {
dialogRef.current?.close();
}
void onClose?.();
},
[onClose],
);
const [isOpen, setIsOpen] = useState(false);

function onEscapeKey() {
Expand Down

0 comments on commit bb0d81a

Please sign in to comment.