mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
fix: statistics widget and page switch crash issue (#504)
This commit is contained in:
parent
fc90a25b52
commit
67cb1455fa
6 changed files with 7 additions and 6 deletions
|
|
@ -91,7 +91,7 @@ export const Statistics = function Statistics({ width, height, properties, style
|
|||
>
|
||||
{primaryValueLabel}
|
||||
</p>
|
||||
<h2 style={primaryStyle}>{primaryValue}</h2>
|
||||
<h2 style={primaryStyle}>{String(primaryValue)}</h2>
|
||||
{hideSecondary ? (
|
||||
''
|
||||
) : (
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ export const Tags = function Tags({ width, height, properties, styles, dataCy })
|
|||
return (
|
||||
<div style={computedStyles} data-cy={dataCy}>
|
||||
{data &&
|
||||
Array.isArray(data) &&
|
||||
data.map((item, index) => {
|
||||
return renderTag(item, index);
|
||||
})}
|
||||
|
|
|
|||
|
|
@ -655,7 +655,7 @@ export const Container = ({
|
|||
}
|
||||
if (Object.keys(value)?.length > 0) {
|
||||
setBoxes((boxes) => {
|
||||
// Ensure boxes[id] exists
|
||||
// Ensure boxes[id] exists. This can happen is page is already switched and the component attributes change gets triggered after that
|
||||
if (!boxes[id]) {
|
||||
console.error(`Box with id ${id} does not exist`);
|
||||
return boxes;
|
||||
|
|
@ -677,7 +677,6 @@ export const Container = ({
|
|||
},
|
||||
});
|
||||
});
|
||||
|
||||
if (!_.isEmpty(opts)) {
|
||||
paramUpdatesOptsRef.current = opts;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
"kind": "runjs",
|
||||
"exposedVariables": {
|
||||
"isLoading": false,
|
||||
"data": {},
|
||||
"rawData": {}
|
||||
"data": [],
|
||||
"rawData": []
|
||||
},
|
||||
"customTesting": true,
|
||||
"disableTransformations": true
|
||||
|
|
|
|||
|
|
@ -1692,6 +1692,7 @@ const EditorComponent = (props) => {
|
|||
const pageHandle = useCurrentStateStore.getState().page?.handle;
|
||||
|
||||
if (currentPageId === pageId && pageHandle === appDefinition?.pages[pageId]?.handle) {
|
||||
useEditorStore.getState().actions.setPageProgress(false);
|
||||
return;
|
||||
}
|
||||
const { name, handle } = appDefinition.pages[pageId];
|
||||
|
|
|
|||
|
|
@ -1995,5 +1995,5 @@ const isChildOfKanbanModal = (
|
|||
return parentComponent.component.component === 'Kanban';
|
||||
}
|
||||
|
||||
return parentComponent.type === 'Kanban';
|
||||
return parentComponent?.type === 'Kanban';
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue