Skip to content

Commit

Permalink
fix: remove uneceessary logic to disable button on search components/…
Browse files Browse the repository at this point in the history
…flows (langflow-ai#2540)

♻️ (index.tsx): simplify disableInputSearch logic by removing redundant conditions
  • Loading branch information
Cristhianzl authored Jul 4, 2024
1 parent 2b8d314 commit 4f586ad
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,8 @@ const InputSearchComponent = ({
}: InputSearchComponentProps) => {
const pagePath = window.location.pathname;
const allFlows = useFlowsManagerStore((state) => state.allFlows);
const searchFlowsComponents = useFlowsManagerStore(
(state) => state.searchFlowsComponents,
);

const disableInputSearch =
loading ||
!allFlows ||
(allFlows?.length === 0 && searchFlowsComponents === "");
const disableInputSearch = loading || !allFlows;

const getSearchPlaceholder = () => {
if (pagePath.includes("flows")) {
Expand Down

0 comments on commit 4f586ad

Please sign in to comment.