Fix custom report editor retaining unsaved settings (#7356)

* Fix custom report editor retaining unsaved settings

The session storage clear condition only fired when navigating from
the /reports dashboard. Since the URL tracking runs inside the report
component, the stored URL always pointed to the last report path, so
revisiting the same report never triggered the clear.

Changed the condition to clear session storage whenever the stored URL
differs from the current path. This handles navigating from the
dashboard, from another report, or any other page.

Fixes #7332

* Add release notes for PR #7356
This commit is contained in:
Trevin Chow
2026-04-07 09:37:43 -07:00
committed by GitHub
parent e3dd3d1d5a
commit a84fb3dae1
2 changed files with 7 additions and 1 deletions

View File

@@ -183,7 +183,7 @@ function CustomReportInner({
sessionStorage.setItem('prevUrl', prevUrl);
sessionStorage.setItem('url', location.pathname);
if (['/reports'].includes(prevUrl)) sessionStorage.clear();
if (prevUrl !== location.pathname) sessionStorage.clear();
const reportFromSessionStorage = sessionStorage.getItem('report');
const session: Partial<CustomReportEntity> = reportFromSessionStorage

View File

@@ -0,0 +1,6 @@
---
category: Bugfixes
authors: [tmchow]
---
Fix custom report editor retaining unsaved settings when navigating between routes.