Skip to content

Commit

Permalink
Allow delay in history graph
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixDQ authored and skovhus committed Aug 3, 2021
1 parent e52ee98 commit a6d6b71
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion web/src/hooks/redux.js
Expand Up @@ -27,7 +27,9 @@ export function useCurrentZoneHistoryDatetimes() {
// the graph (when not inferable from historyData timestamps).
export function useCurrentZoneHistoryEndTime() {
const customDatetime = useCustomDatetime();
const gridDatetime = useSelector((state) => (state.data.grid || {}).datetime);
const gridDatetime =
useSelector((state) => (state.data.grid || {}).datetime) ||
moment().subtract(2, 'hour').startOf('hour');

return useMemo(
() => moment(customDatetime || gridDatetime).format(),
Expand Down

0 comments on commit a6d6b71

Please sign in to comment.