mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
* fixed unsaved changes out of sync after save and return
This commit is contained in:
parent
c0586e5a34
commit
d252005038
1 changed files with 2 additions and 4 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue