mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-13 14:08:58 +08:00
fix: reevaluated newdashboard bool to ensure that widget doesn't exist, incase of a prior PUT call (#7525)
* fix: reevaluated newdashboard bool to ensure that widget doesn't exist, incase of a prior PUT call * fix: resolved comment
This commit is contained in:
parent
2330420c0d
commit
e53d3d1269
@ -115,9 +115,8 @@ function NewWidget({ selectedGraph }: NewWidgetProps): JSX.Element {
|
|||||||
const widgetId = query.get('widgetId');
|
const widgetId = query.get('widgetId');
|
||||||
const selectedWidget = widgets?.find((e) => e.id === widgetId);
|
const selectedWidget = widgets?.find((e) => e.id === widgetId);
|
||||||
const isWidgetNotPresent = isUndefined(selectedWidget);
|
const isWidgetNotPresent = isUndefined(selectedWidget);
|
||||||
if (isWidgetNotPresent) {
|
|
||||||
setIsNewDashboard(true);
|
setIsNewDashboard(isWidgetNotPresent);
|
||||||
}
|
|
||||||
|
|
||||||
if (!logEventCalledRef.current) {
|
if (!logEventCalledRef.current) {
|
||||||
logEvent('Panel Edit: Page visited', {
|
logEvent('Panel Edit: Page visited', {
|
||||||
@ -131,7 +130,7 @@ function NewWidget({ selectedGraph }: NewWidgetProps): JSX.Element {
|
|||||||
logEventCalledRef.current = true;
|
logEventCalledRef.current = true;
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, [widgets]);
|
||||||
|
|
||||||
const getWidget = useCallback(() => {
|
const getWidget = useCallback(() => {
|
||||||
const widgetId = query.get('widgetId');
|
const widgetId = query.get('widgetId');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user