Skip to content

Commit

Permalink
fix(insights): Fix dashboard not stale when removing date (#22888)
Browse files Browse the repository at this point in the history
Fix dashboard not stale when removing date
  • Loading branch information
webjunkie authored Jun 12, 2024
1 parent 336367f commit 2e60b33
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions frontend/src/scenes/dashboard/dashboardLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -826,12 +826,17 @@ export const dashboardLogic = kea<dashboardLogicType>([
stale: [
(s) => [s.temporaryFilters, s.dashboard],
(temporaryFilters, dashboard) => {
return !!(
(temporaryFilters.date_from && temporaryFilters.date_from !== dashboard?.filters.date_from) ||
(temporaryFilters.date_to && temporaryFilters.date_to !== dashboard?.filters.date_to) ||
(temporaryFilters.properties &&
JSON.stringify(temporaryFilters.properties) !== JSON.stringify(dashboard?.filters.properties))
)
const isDateFromStale =
!!(temporaryFilters.date_from || dashboard?.filters.date_from) &&
temporaryFilters.date_from !== dashboard?.filters.date_from
const isDateToStale =
!!(temporaryFilters.date_to || dashboard?.filters.date_to) &&
temporaryFilters.date_to !== dashboard?.filters.date_to
const isPropertiesStale =
!!(temporaryFilters.properties || dashboard?.filters.properties) &&
JSON.stringify(temporaryFilters.properties) !== JSON.stringify(dashboard?.filters.properties)

return isDateFromStale || isDateToStale || isPropertiesStale
},
],
})),
Expand Down

0 comments on commit 2e60b33

Please sign in to comment.