mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 09:28:11 +00:00
Set state in a useEffect to avoid react warning
This commit is contained in:
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]);
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user