mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-18 16:07:10 +00:00
fix: back button issue in trace details page (#8347)
This commit is contained in:
parent
564edc7430
commit
525a0d7a1a
@ -43,13 +43,7 @@ function TraceMetadata(props: ITraceMetadataProps): JSX.Element {
|
|||||||
<ArrowLeft
|
<ArrowLeft
|
||||||
size={14}
|
size={14}
|
||||||
onClick={(): void => {
|
onClick={(): void => {
|
||||||
// Check if page was opened in new tab (no referrer from same origin)
|
if (window.history.length > 1) {
|
||||||
// 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) {
|
|
||||||
history.goBack();
|
history.goBack();
|
||||||
} else {
|
} else {
|
||||||
history.push(ROUTES.TRACES_EXPLORER);
|
history.push(ROUTES.TRACES_EXPLORER);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user