Skip to content

Commit

Permalink
fix: Fix property definitions table page problems (#21460)
Browse files Browse the repository at this point in the history
  • Loading branch information
webjunkie authored Apr 15, 2024
1 parent 4742724 commit bad1e7e
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,13 @@ export const propertyDefinitionsTableLogic = kea<propertyDefinitionsTableLogicTy
],
})),
listeners(({ actions, values, cache }) => ({
setFilters: () => {
setFilters: async (_, breakpoint) => {
await breakpoint(500)
actions.loadPropertyDefinitions(
normalizePropertyDefinitionEndpointUrl(
values.propertyDefinitions.current,
{
offset: 0,
search: values.filters.property,
type: values.filters.type,
group_type_index: values.filters.group_type_index,
Expand Down Expand Up @@ -200,9 +202,12 @@ export const propertyDefinitionsTableLogic = kea<propertyDefinitionsTableLogicTy
})),
urlToAction(({ actions, values }) => ({
[urls.propertyDefinitions()]: (_, searchParams) => {
if (values.propertyDefinitionsLoading) {
return
}
if (!objectsEqual(cleanFilters(values.filters), cleanFilters(router.values.searchParams))) {
actions.setFilters(searchParams as Filters)
} else if (!values.propertyDefinitions.results.length && !values.propertyDefinitionsLoading) {
} else if (!values.propertyDefinitions.results.length) {
actions.loadPropertyDefinitions()
}
},
Expand Down

0 comments on commit bad1e7e

Please sign in to comment.