From 15004bd6335b23218088b123dfa63a8f58abfcc5 Mon Sep 17 00:00:00 2001 From: Kavin Venkatachalam Date: Tue, 28 May 2024 18:44:26 +0530 Subject: [PATCH] fix: canvas background color was not working when the color is selected with the color picker --- frontend/src/Editor/Editor.jsx | 6 ++++++ frontend/src/Editor/Viewer.jsx | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/frontend/src/Editor/Editor.jsx b/frontend/src/Editor/Editor.jsx index efa476d1e6..ec46785fce 100644 --- a/frontend/src/Editor/Editor.jsx +++ b/frontend/src/Editor/Editor.jsx @@ -1507,6 +1507,12 @@ const EditorComponent = (props) => { isUpdatingEditorStateInProcess: false, appDefinition: newAppDefinition, }); + } else { + // Setting the canvas background to the editor store + setCanvasBackground({ + backgroundFxQuery: globalSettings?.backgroundFxQuery, + canvasBackgroundColor: globalSettings?.canvasBackgroundColor, + }); } if (Array.isArray(entityReferencesInComponentDefinitions) && entityReferencesInComponentDefinitions?.length > 0) { diff --git a/frontend/src/Editor/Viewer.jsx b/frontend/src/Editor/Viewer.jsx index e15715440b..fdba792bd0 100644 --- a/frontend/src/Editor/Viewer.jsx +++ b/frontend/src/Editor/Viewer.jsx @@ -165,6 +165,12 @@ class ViewerComponent extends React.Component { isUpdatingEditorStateInProcess: false, appDefinition: newAppDefinition, }); + } else { + // Setting the canvas background to the editor store + useEditorStore.getState().actions.setCanvasBackground({ + backgroundFxQuery: globalSettings?.backgroundFxQuery, + canvasBackgroundColor: globalSettings?.canvasBackgroundColor, + }); } if (Array.isArray(entityReferencesInComponentDefinitions) && entityReferencesInComponentDefinitions?.length > 0) {