Fixes toggle layout widget visibility (#2184)

This commit is contained in:
Kiran Ashok 2022-02-08 08:53:14 +05:30 committed by GitHub
parent f2088be23b
commit 5d3aefdec4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,7 +7,7 @@ import { DraggableBox } from './DraggableBox';
import { snapToGrid as doSnapToGrid } from './snapToGrid';
import update from 'immutability-helper';
import { componentTypes } from './Components/components';
import { computeComponentName } from '@/_helpers/utils';
import { computeComponentName, resolveReferences } from '@/_helpers/utils';
import useRouter from '@/_hooks/use-router';
import Comments from './Comments';
import { commentsService } from '@/_services';
@ -201,7 +201,6 @@ export const Container = ({
},
},
});
return undefined;
},
}),
@ -437,8 +436,7 @@ export const Container = ({
const box = boxes[key];
const canShowInCurrentLayout =
box.component.definition.others[currentLayout === 'mobile' ? 'showOnMobile' : 'showOnDesktop'].value;
if (!box.parent && canShowInCurrentLayout) {
if (!box.parent && resolveReferences(canShowInCurrentLayout, currentState)) {
return (
<DraggableBox
className={showComments && 'pointer-events-none'}