Set state in a useEffect to avoid react warning

This commit is contained in:
Tanish Manku committed 2025-08-27 14:14:28 -07:00
1 parent d2f59414c8
commit bba4db0f91
1 file changed
+8 -5
@@ -249,11 +249,14 @@ const PageEdit = () => {
//const supportsMaskedInpainting = modelConfig?.tags?.includes(ModelTag.MaskedInpainting) ?? false;
const supportsMaskedInpainting = selectedImageModel?.usesInpaintingMask ?? false;
if (!supportsMaskedInpainting && (store.activeTool !== "select" || store.lineNodes.length > 0)) {
// TODO: Implement a new mode for unsupported masking and hide the nodes layer instead of clearing
store.setActiveTool("select");
store.clearLineNodes();
}
useEffect(() => {
if (!supportsMaskedInpainting && (store.activeTool !== "select" || store.lineNodes.length > 0)) {
// TODO: Implement a new mode for unsupported masking and hide the nodes layer instead of clearing
store.setActiveTool("select");
store.clearLineNodes();
}
}, [store, supportsMaskedInpainting]);
/*
*