Skip to content

Commit

Permalink
fixed unsaved changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Sep 30, 2024
1 parent e9eed27 commit 85bdf40
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,16 @@ export function startDiffingDashboardState(
* Create an observable stream that checks for unsaved changes in the Dashboard state
* and the state of all of its legacy embeddable children.
*/
const dashboardUnsavedChanges = this.anyReducerRun.pipe(
startWith(null),
const dashboardUnsavedChanges = combineLatest([
this.anyReducerRun.pipe(startWith(null)),
this.lastSavedInput$,
]).pipe(
debounceTime(CHANGE_CHECK_DEBOUNCE),
switchMap(() => {
switchMap(([, lastSavedInput]) => {
return (async () => {
const { explicitInput: currentInput } = this.getState();
const unsavedChanges = await getDashboardUnsavedChanges.bind(this)(
this.lastSavedInput$.value,
lastSavedInput,
currentInput
);
return unsavedChanges;
Expand Down

0 comments on commit 85bdf40

Please sign in to comment.