Skip to content

Commit

Permalink
fix(ui): fix bug with usePanel
Browse files Browse the repository at this point in the history
  • Loading branch information
psychedelicious committed Jul 10, 2024
1 parent df58d4a commit 3075150
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions invokeai/frontend/web/src/features/ui/hooks/usePanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,14 @@ export const usePanel = (arg: UsePanelOptions): UsePanelReturn => {

const onDoubleClickHandle = useCallback(() => {
// If the panel is really super close to the min size, collapse it
if (Math.abs((panelHandleRef.current?.getSize() ?? 0) - _minSize) < 0.01) {
if (Math.abs((panelHandleRef.current?.getSize() ?? 0) - _defaultSize) < 0.01) {
collapse();
return;
}

// Otherwise, resize to the min size
panelHandleRef.current?.resize(_defaultSize);
}, [_defaultSize, _minSize, collapse]);
}, [_defaultSize, collapse]);

return {
ref: panelHandleRef,
Expand Down

0 comments on commit 3075150

Please sign in to comment.