Skip to content

Commit

Permalink
[Search] Fix infinite loop on search index page
Browse files Browse the repository at this point in the history
  • Loading branch information
sphilipse committed Mar 7, 2024
1 parent 1d847f6 commit aeb7119
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { Status } from '../../../../../common/types/api';
import { ElasticsearchIndexWithIngestion } from '../../../../../common/types/indices';

import { Actions } from '../../../shared/api_logic/create_api_logic';
import { IndexNameLogic } from '../../components/search_index/index_name_logic';

import {
FetchIndexApiParams,
Expand Down Expand Up @@ -56,7 +57,12 @@ export const CachedFetchIndexApiLogic = kea<
},
connect: {
actions: [FetchIndexApiLogic, ['apiSuccess', 'apiError', 'apiReset', 'makeRequest']],
values: [FetchIndexApiLogic, ['data as fetchIndexApiData', 'status']],
values: [
FetchIndexApiLogic,
['data as fetchIndexApiData', 'status'],
IndexNameLogic,
['indexName'],
],
},
events: ({ values }) => ({
beforeUnmount: () => {
Expand Down Expand Up @@ -114,13 +120,6 @@ export const CachedFetchIndexApiLogic = kea<
},
},
],
indexName: [
'',
{
apiReset: () => '',
startPolling: (_, { indexName }) => indexName,
},
],
pollTimeoutId: [
null,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,9 @@ export const ConnectorViewLogic = kea<MakeLogicType<ConnectorViewValues, Connect
events: ({ actions }) => ({
beforeMount: () => {
actions.fetchConnectorApiReset();
actions.fetchIndexApiReset();
},
beforeUnmount: () => {
actions.fetchConnectorApiReset();
actions.fetchIndexApiReset();
actions.stopConnectorPoll();
},
}),
Expand Down

0 comments on commit aeb7119

Please sign in to comment.