mirror of
https://github.com/actualbudget/actual.git
synced 2026-05-06 07:01:45 -05:00
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:
@@ -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
|
||||
|
||||
6
upcoming-release-notes/7356.md
Normal file
6
upcoming-release-notes/7356.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Bugfixes
|
||||
authors: [tmchow]
|
||||
---
|
||||
|
||||
Fix custom report editor retaining unsaved settings when navigating between routes.
|
||||
Reference in New Issue
Block a user