fix: canvas background color was not working when the color is selected with the color picker

This commit is contained in:
Kavin Venkatachalam 2024-05-28 18:44:26 +05:30
parent 12c4a0211d
commit 15004bd633
2 changed files with 12 additions and 0 deletions

View file

@ -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) {

View file

@ -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) {