msyavuz commented on code in PR #35817:
URL: https://github.com/apache/superset/pull/35817#discussion_r2466791147
##########
superset-frontend/src/dashboard/components/Header/index.jsx:
##########
@@ -325,10 +326,16 @@ const Header = () => {
startPeriodicRender(refreshFrequency * 1000);
}, [refreshFrequency, startPeriodicRender]);
- // Ensure theme changes are tracked as unsaved changes
+ // Track theme changes as unsaved changes, and sync ref when navigating
between dashboards
useEffect(() => {
- if (editMode && dashboardInfo.theme !== undefined) {
- boundActionCreators.setUnsavedChanges(true);
+ if (editMode) {
+ if (dashboardInfo.theme !== previousThemeRef.current) {
+ boundActionCreators.setUnsavedChanges(true);
+ previousThemeRef.current = dashboardInfo.theme;
+ }
+ } else {
+ // Sync ref when navigating between dashboards to avoid false positives
+ previousThemeRef.current = dashboardInfo.theme;
Review Comment:
Shouldn't removing this also work?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]