From bad1e7e8beca1ad8b08a58ca054a400c487de36d Mon Sep 17 00:00:00 2001 From: Julian Bez Date: Mon, 15 Apr 2024 12:07:14 +0100 Subject: [PATCH] fix: Fix property definitions table page problems (#21460) --- .../properties/propertyDefinitionsTableLogic.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/src/scenes/data-management/properties/propertyDefinitionsTableLogic.ts b/frontend/src/scenes/data-management/properties/propertyDefinitionsTableLogic.ts index a9a1541df21f8..fad143572f570 100644 --- a/frontend/src/scenes/data-management/properties/propertyDefinitionsTableLogic.ts +++ b/frontend/src/scenes/data-management/properties/propertyDefinitionsTableLogic.ts @@ -155,11 +155,13 @@ export const propertyDefinitionsTableLogic = kea ({ - 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, @@ -200,9 +202,12 @@ export const propertyDefinitionsTableLogic = kea ({ [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() } },