[Time to Visualize] Fix Unsaved Changes Badge Appearing After Save & Return (#94529)
* fixed unsaved changes out of sync after save and return
This commit is contained in:
parent
f62478452e
commit
644e08b94f
|
@ -80,11 +80,7 @@ export const useDashboardContainer = ({
|
|||
searchSession.restore(searchSessionIdFromURL);
|
||||
}
|
||||
|
||||
// when dashboard state manager initially loads, determine whether or not there are unsaved changes
|
||||
const incomingEmbeddable = getIncomingEmbeddable(true);
|
||||
setUnsavedChanges?.(
|
||||
Boolean(incomingEmbeddable) || dashboardStateManager.hasUnsavedPanelState()
|
||||
);
|
||||
|
||||
let canceled = false;
|
||||
let pendingContainer: DashboardContainer | ErrorEmbeddable | null | undefined;
|
||||
|
@ -137,6 +133,7 @@ export const useDashboardContainer = ({
|
|||
);
|
||||
}
|
||||
setDashboardContainer(pendingContainer);
|
||||
setUnsavedChanges?.(dashboardStateManager.getIsDirty(data.query.timefilter.timefilter));
|
||||
})();
|
||||
return () => {
|
||||
canceled = true;
|
||||
|
@ -151,6 +148,7 @@ export const useDashboardContainer = ({
|
|||
setDashboardContainer(null);
|
||||
};
|
||||
}, [
|
||||
data.query.timefilter.timefilter,
|
||||
dashboardCapabilities,
|
||||
dashboardStateManager,
|
||||
getIncomingEmbeddable,
|
||||
|
|
Loading…
Reference in a new issue