Undefined issues

This commit is contained in:
Elizabeth Cray 2023-07-23 20:38:50 -04:00
parent 454108a959
commit b2e042a36b

View File

@ -93,6 +93,7 @@ function App() {
};
const handleSubClick = (topic: string, index: number) => {
if (codes){
let text = getTopicChildren(topic)[index];
let filtered = codes.filter((code: Code) => code.type === topic && code.text === text);
if (filtered.length == 1) {
@ -100,6 +101,7 @@ function App() {
setSubTopic("");
invoke('type_str', {input: payload});
}
}
};
const SubMenu = () => {
@ -132,6 +134,7 @@ function App() {
}
const handleTopicClick = (type: string) => {
if (codes) {
let filtered = codes.filter((code: Code) => code.type === type);
if (filtered.length == 1) {
let assembledStr: string = generatePayload(filtered[0]);
@ -141,6 +144,7 @@ function App() {
// Open Submenu for type
setSubTopic(type);
}
}
};
const buildMenu = () => {
@ -167,7 +171,6 @@ function App() {
})}
</div>
);
// TODO: This isn't returning as expected, use an object to append to then return the compiled list
}else{
return (<div></div>);
}