fix: back button issue in trace details page (#8347)

This commit is contained in:
Sahil Khan 2025-06-24 20:57:24 +05:30 committed by GitHub
parent 564edc7430
commit 525a0d7a1a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -43,13 +43,7 @@ function TraceMetadata(props: ITraceMetadataProps): JSX.Element {
<ArrowLeft
size={14}
onClick={(): void => {
// Check if page was opened in new tab (no referrer from same origin)
// or if there's no meaningful history to go back to
const hasValidReferrer =
document.referrer &&
new URL(document.referrer).origin === window.location.origin;
if (hasValidReferrer && window.history.length > 1) {
if (window.history.length > 1) {
history.goBack();
} else {
history.push(ROUTES.TRACES_EXPLORER);