Undefined issues
This commit is contained in:
parent
454108a959
commit
b2e042a36b
33
src/App.tsx
33
src/App.tsx
@ -93,12 +93,14 @@ function App() {
|
||||
};
|
||||
|
||||
const handleSubClick = (topic: string, index: number) => {
|
||||
let text = getTopicChildren(topic)[index];
|
||||
let filtered = codes.filter((code: Code) => code.type === topic && code.text === text);
|
||||
if (filtered.length == 1) {
|
||||
let payload: string = generatePayload(filtered[0]);
|
||||
setSubTopic("");
|
||||
invoke('type_str', {input: payload});
|
||||
if (codes){
|
||||
let text = getTopicChildren(topic)[index];
|
||||
let filtered = codes.filter((code: Code) => code.type === topic && code.text === text);
|
||||
if (filtered.length == 1) {
|
||||
let payload: string = generatePayload(filtered[0]);
|
||||
setSubTopic("");
|
||||
invoke('type_str', {input: payload});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -132,14 +134,16 @@ function App() {
|
||||
}
|
||||
|
||||
const handleTopicClick = (type: string) => {
|
||||
let filtered = codes.filter((code: Code) => code.type === type);
|
||||
if (filtered.length == 1) {
|
||||
let assembledStr: string = generatePayload(filtered[0]);
|
||||
setSubTopic("");
|
||||
invoke('type_str', {input: assembledStr});
|
||||
}else{
|
||||
// Open Submenu for type
|
||||
setSubTopic(type);
|
||||
if (codes) {
|
||||
let filtered = codes.filter((code: Code) => code.type === type);
|
||||
if (filtered.length == 1) {
|
||||
let assembledStr: string = generatePayload(filtered[0]);
|
||||
setSubTopic("");
|
||||
invoke('type_str', {input: assembledStr});
|
||||
}else{
|
||||
// Open Submenu for type
|
||||
setSubTopic(type);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -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>);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user