Skip to content

Commit

Permalink
Merge pull request #294 from XpressAI/fahreza/fix-fetch-component-pan…
Browse files Browse the repository at this point in the history
…el-spawn

🐛 Fix Component Panel Freeze on Spawn
  • Loading branch information
MFA-X-AI authored Feb 16, 2024
2 parents ba1f9b1 + a58bf87 commit a4257f0
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/context-menu/ComponentsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ export default function ComponentsPanel(props: ComponentsPanelProps) {
const [componentList, setComponentList] = React.useState([]);
const [category, setCategory] = React.useState([]);
const [searchTerm, setSearchTerm] = useState('');
const [runOnce, setRunOnce] = useState(false);
const [allowableComponents, setAllowableComponents] = useState([]);

let handleOnChange = (event) => {
Expand Down Expand Up @@ -151,12 +150,8 @@ export default function ComponentsPanel(props: ComponentsPanelProps) {
}

useEffect(() => {
if (!runOnce) {
fetchComponentList();
setRunOnce(true);
}

}, [category, componentList]);
fetchComponentList();
}, []);

function focusInput() {
document.getElementById("add-component-input").focus();
Expand Down

0 comments on commit a4257f0

Please sign in to comment.