Skip to content
Snippets Groups Projects
Unverified Commit 37d201b6 authored by Matiss Janis Aboltins's avatar Matiss Janis Aboltins Committed by GitHub
Browse files

:bug: fix custom reports crashing when opening table (#3484)

parent d1ecb3db
No related branches found
No related tags found
No related merge requests found
......@@ -387,6 +387,7 @@ export function CustomReport() {
]);
const getGraphData = useMemo(() => {
// TODO: fix me - state mutations should not happen inside `useMemo`
setDataCheck(false);
return createCustomSpreadsheet({
startDate,
......@@ -454,6 +455,16 @@ export function CustomReport() {
const navigate = useNavigate();
const [, setScrollWidth] = useState(0);
useEffect(() => {
if (disabledLegendLabel(mode, graphType, 'disableLegend')) {
setViewLegendPref(false);
}
if (disabledLegendLabel(mode, graphType, 'disableLabel')) {
setViewLabelsPref(false);
}
}, [setViewLegendPref, setViewLabelsPref, mode, graphType]);
if (!allIntervals || !data) {
return null;
}
......@@ -516,15 +527,9 @@ export function CustomReport() {
const isItemDisabled = (type: string) => {
switch (type) {
case 'ShowLegend': {
if (disabledLegendLabel(mode, graphType, 'disableLegend')) {
setViewLegendPref(false);
}
return disabledLegendLabel(mode, graphType, 'disableLegend') || false;
}
case 'ShowLabels': {
if (disabledLegendLabel(mode, graphType, 'disableLabel')) {
setViewLabelsPref(false);
}
return disabledLegendLabel(mode, graphType, 'disableLabel') || false;
}
default:
......
---
category: Bugfix
authors: [MatissJanis]
---
Custom reports - fix opening table reports crashing the page.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment