mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): fix bug with usePanel
This commit is contained in:
parent
ec1b429d45
commit
88c3a71586
@ -203,14 +203,14 @@ export const usePanel = (arg: UsePanelOptions): UsePanelReturn => {
|
|||||||
|
|
||||||
const onDoubleClickHandle = useCallback(() => {
|
const onDoubleClickHandle = useCallback(() => {
|
||||||
// If the panel is really super close to the min size, collapse it
|
// 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();
|
collapse();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, resize to the min size
|
// Otherwise, resize to the min size
|
||||||
panelHandleRef.current?.resize(_defaultSize);
|
panelHandleRef.current?.resize(_defaultSize);
|
||||||
}, [_defaultSize, _minSize, collapse]);
|
}, [_defaultSize, collapse]);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
ref: panelHandleRef,
|
ref: panelHandleRef,
|
||||||
|
Loading…
Reference in New Issue
Block a user