Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/components/Admin/common/RepositorySidebarOverlay/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
type HistoryEntryLocation
} from "../../../../history/History";
import { usePrevious } from "../../../../hooks/usePrevious";
import { useStableSearchParams } from "../../../../hooks/useStableSearchParams";
import {
digmaApi,
useGetSpanInfoQuery
Expand Down Expand Up @@ -87,6 +88,7 @@
() => new History<RepositorySidebarHistoryState>([])
);
const previousIsSidebarOpen = usePrevious(isSidebarOpen);
const [, setSearchParams] = useStableSearchParams();

const { data: spanInfo } = useGetSpanInfoQuery(
{ spanCodeObjectId: currentSpanCodeObjectId ?? "" },
Expand Down Expand Up @@ -130,9 +132,17 @@
e: CustomEvent<HistoryEntry<RepositorySidebarHistoryState>>
) => {
setCurrentSpanCodeObjectId(e.detail.state?.spanCodeObjectId);
setCurrentTabLocation(
e.detail.state?.tabLocation ?? { id: TAB_IDS.ISSUES }
);
const newTabLocation = e.detail.state?.tabLocation ?? {
id: TAB_IDS.ISSUES
};
setCurrentTabLocation(newTabLocation);
setSearchParams((params) => {
if (spanInfo?.uid) {
params.set("sidebar-scope", spanInfo.uid);
}
params.set("sidebar-view", JSON.stringify(newTabLocation));
return params;
});
};

window.addEventListener(
Expand All @@ -154,7 +164,7 @@
handleHistoryChangeOrNavigate as EventListener
);
};
}, []);

Check warning on line 167 in src/components/Admin/common/RepositorySidebarOverlay/index.tsx

View workflow job for this annotation

GitHub Actions / Lint & test / build

React Hook useEffect has missing dependencies: 'setSearchParams' and 'spanInfo.uid'. Either include them or remove the dependency array

useEffect(() => {
const newSpanCodeObjectId = sidebarQuery?.query?.scopedSpanCodeObjectId;
Expand Down
1 change: 1 addition & 0 deletions src/redux/services/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,7 @@ export interface GetSpanInfoResponse {
firstSeen?: string;
lastSeen?: string;
linkedEndpoints?: LinkedEndpoint[];
uid?: string;
}

export interface GetSpanEnvironmentsPayload {
Expand Down
Loading