Skip to content

Commit

Permalink
Undo change which backed up time range into session storage
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomThomson committed Sep 27, 2022
1 parent 05fb7ee commit 1d93a4d
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Side Public License, v 1.
*/

import { omit } from 'lodash';
import { History } from 'history';
import { debounceTime, switchMap } from 'rxjs/operators';
import { useCallback, useEffect, useMemo, useState } from 'react';
Expand Down Expand Up @@ -268,7 +269,15 @@ export const useDashboardAppState = ({
setDashboardAppState((s) => ({ ...s, hasUnsavedChanges }));

unsavedChanges.viewMode = current.viewMode; // always push view mode into session store.
dashboardSessionStorage.setState(savedDashboardId, unsavedChanges);

/**
* Current behaviour expects time range not to be backed up.
* TODO: Revisit this. It seems like we should treat all state the same.
*/
dashboardSessionStorage.setState(
savedDashboardId,
omit(unsavedChanges, ['timeRange', 'refreshInterval'])
);
});
});
})
Expand Down

0 comments on commit 1d93a4d

Please sign in to comment.