mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Fix unnecessary gallery re-renders
This commit is contained in:
parent
c6112e3295
commit
78217f5ef9
@ -81,7 +81,6 @@ export default function ImageGallery() {
|
|||||||
shouldEnableResize,
|
shouldEnableResize,
|
||||||
} = useAppSelector(imageGallerySelector);
|
} = useAppSelector(imageGallerySelector);
|
||||||
|
|
||||||
console.log(isLightBoxOpen);
|
|
||||||
const { galleryMinWidth, galleryMaxWidth } = isLightBoxOpen
|
const { galleryMinWidth, galleryMaxWidth } = isLightBoxOpen
|
||||||
? {
|
? {
|
||||||
galleryMinWidth: LIGHTBOX_GALLERY_WIDTH,
|
galleryMinWidth: LIGHTBOX_GALLERY_WIDTH,
|
||||||
|
@ -10,6 +10,7 @@ import {
|
|||||||
setShowDualDisplay,
|
setShowDualDisplay,
|
||||||
} from 'features/options/store/optionsSlice';
|
} from 'features/options/store/optionsSlice';
|
||||||
import { setDoesCanvasNeedScaling } from 'features/canvas/store/canvasSlice';
|
import { setDoesCanvasNeedScaling } from 'features/canvas/store/canvasSlice';
|
||||||
|
import _ from 'lodash';
|
||||||
|
|
||||||
const workareaSelector = createSelector(
|
const workareaSelector = createSelector(
|
||||||
[(state: RootState) => state.options, activeTabNameSelector],
|
[(state: RootState) => state.options, activeTabNameSelector],
|
||||||
@ -21,6 +22,11 @@ const workareaSelector = createSelector(
|
|||||||
isLightBoxOpen,
|
isLightBoxOpen,
|
||||||
shouldShowDualDisplayButton: ['inpainting'].includes(activeTabName),
|
shouldShowDualDisplayButton: ['inpainting'].includes(activeTabName),
|
||||||
};
|
};
|
||||||
|
},
|
||||||
|
{
|
||||||
|
memoizeOptions: {
|
||||||
|
resultEqualityCheck: _.isEqual,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user