From 5d3aefdec49f73ade18b4965ea314d42f47213e9 Mon Sep 17 00:00:00 2001 From: Kiran Ashok Date: Tue, 8 Feb 2022 08:53:14 +0530 Subject: [PATCH] Fixes toggle layout widget visibility (#2184) --- frontend/src/Editor/Container.jsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/src/Editor/Container.jsx b/frontend/src/Editor/Container.jsx index 7c0a8de387..0bac6ff30e 100644 --- a/frontend/src/Editor/Container.jsx +++ b/frontend/src/Editor/Container.jsx @@ -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 (