Skip to content

Commit

Permalink
fix: replace history.push with safeNavigate in TracesExplorer's updat…
Browse files Browse the repository at this point in the history
…eDashboard
  • Loading branch information
ahmadshaheer committed Dec 30, 2024
1 parent 38c10c0 commit bab2667
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/src/pages/TracesExplorer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
import { useShareBuilderUrl } from 'hooks/queryBuilder/useShareBuilderUrl';
import { useHandleExplorerTabChange } from 'hooks/useHandleExplorerTabChange';
import { useNotifications } from 'hooks/useNotifications';
import history from 'lib/history';
import { useSafeNavigate } from 'hooks/useSafeNavigate';
import { cloneDeep, isEmpty, set } from 'lodash-es';
import ErrorBoundaryFallback from 'pages/ErrorBoundaryFallback/ErrorBoundaryFallback';
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
Expand Down Expand Up @@ -61,6 +61,7 @@ function TracesExplorer(): JSX.Element {
const currentPanelType = useGetPanelTypesQueryParam();

const { handleExplorerTabChange } = useHandleExplorerTabChange();
const { safeNavigate } = useSafeNavigate();

const currentTab = panelType || PANEL_TYPES.LIST;

Expand Down Expand Up @@ -197,7 +198,7 @@ function TracesExplorer(): JSX.Element {
widgetId,
});

history.push(dashboardEditView);
safeNavigate(dashboardEditView);
},
onError: (error) => {
if (axios.isAxiosError(error)) {
Expand Down

0 comments on commit bab2667

Please sign in to comment.