Fixed error showing when not supposed to
This commit is contained in:
parent
ce2f750626
commit
2720d27e30
1 changed files with 11 additions and 7 deletions
|
|
@ -60,12 +60,13 @@ export default function ExtraSidebar() {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// show components with error on load
|
// show components with error on load
|
||||||
let errors = [];
|
let errors = [];
|
||||||
Object.keys(templates).forEach(component => {
|
Object.keys(templates).forEach((component) => {
|
||||||
if (templates[component].error) {
|
if (templates[component].error) {
|
||||||
errors.push(component);
|
errors.push(component);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
setErrorData({title:" Components with errors: ",list:errors})
|
if (errors.length > 0)
|
||||||
|
setErrorData({ title: " Components with errors: ", list: errors });
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -183,7 +184,10 @@ export default function ExtraSidebar() {
|
||||||
<div
|
<div
|
||||||
draggable={!data[d][t].error}
|
draggable={!data[d][t].error}
|
||||||
className={
|
className={
|
||||||
"side-bar-components-border bg-background" + (data[d][t].error ? " select-none cursor-not-allowed" : "")
|
"side-bar-components-border bg-background" +
|
||||||
|
(data[d][t].error
|
||||||
|
? " cursor-not-allowed select-none"
|
||||||
|
: "")
|
||||||
}
|
}
|
||||||
style={{
|
style={{
|
||||||
borderLeftColor:
|
borderLeftColor:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue