fix: remove uneceessary logic to disable button on search components/flows (#2540)
♻️ (index.tsx): simplify disableInputSearch logic by removing redundant conditions
This commit is contained in:
parent
2b8d314e30
commit
4f586adf0a
1 changed files with 1 additions and 7 deletions
|
|
@ -22,14 +22,8 @@ const InputSearchComponent = ({
|
||||||
}: InputSearchComponentProps) => {
|
}: InputSearchComponentProps) => {
|
||||||
const pagePath = window.location.pathname;
|
const pagePath = window.location.pathname;
|
||||||
const allFlows = useFlowsManagerStore((state) => state.allFlows);
|
const allFlows = useFlowsManagerStore((state) => state.allFlows);
|
||||||
const searchFlowsComponents = useFlowsManagerStore(
|
|
||||||
(state) => state.searchFlowsComponents,
|
|
||||||
);
|
|
||||||
|
|
||||||
const disableInputSearch =
|
const disableInputSearch = loading || !allFlows;
|
||||||
loading ||
|
|
||||||
!allFlows ||
|
|
||||||
(allFlows?.length === 0 && searchFlowsComponents === "");
|
|
||||||
|
|
||||||
const getSearchPlaceholder = () => {
|
const getSearchPlaceholder = () => {
|
||||||
if (pagePath.includes("flows")) {
|
if (pagePath.includes("flows")) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue