Skip to content

Commit

Permalink
fix(search-indexes): avoid flicker when modal closes COMPASS-7248 (#4934
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mabaasit authored Oct 2, 2023
1 parent 7b7bafb commit ba757dc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,6 @@ export const BaseSearchIndexModal: React.FunctionComponent<
if (isModalOpen) {
setIndexName(initialIndexName);
setIndexDefinition(initialIndexDefinition);
} else {
// Reset the name and definition when modal is closed.
setIndexName('');
setIndexDefinition('{}');
setParsingError(undefined);
}
}, [isModalOpen, initialIndexName, initialIndexDefinition]);
Expand Down
3 changes: 2 additions & 1 deletion packages/compass-indexes/src/modules/search-indexes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,11 @@ export default function reducer(
return {
...state,
updateIndex: {
// We do not clear the indexName here to avoid flicker created by LG
// Modal as it closes.
...state.updateIndex,
isBusy: false,
isModalOpen: false,
indexName: '',
},
};
}
Expand Down

0 comments on commit ba757dc

Please sign in to comment.