Skip to content

Commit 296ebb6

Browse files
Merge pull request #86 from SingularityNET-Archive:development
Fix initial options bug and remove console.log statement
2 parents f249f8c + b4b0b25 commit 296ebb6

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

components/SelectNames.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ const SelectNames: React.FC<SelectNamesProps> = ({ onSelect, initialValue }) =>
1919
{ value: 'vanilla', label: 'Vanilla' }
2020
];
2121

22+
React.useEffect(() => {
23+
let initialOptions = initialValue ? initialValue.split(", ").map(val => ({ label: val, value: val })) : [];
24+
setSelectedLabels(initialOptions);
25+
}, [initialValue]);
26+
2227
async function handleInputChange(selected: any) {
2328
setSelectedLabels(selected); // Update local state
2429
let labs: string[] = selected.map((item: any) => item.label);

components/SummaryTemplate.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ const SummaryTemplate = ({ updateMeetings }: SummaryTemplateProps) => {
251251
setLoading(true);
252252

253253
try {
254+
//console.log("test", cleanedFormData)
254255
const data = await saveCustomAgenda(cleanedFormData);
255256
if (data !== false) {
256257
//console.log("Calling updateMeetings with:", summary, data[0].date);
@@ -281,7 +282,7 @@ const SummaryTemplate = ({ updateMeetings }: SummaryTemplateProps) => {
281282
setMyVariable(updatedMyVariable);
282283
} else {
283284
console.log("Error in saving custom agenda");
284-
}
285+
}
285286
} catch (error) {
286287
console.error("Error submitting the form:", error);
287288
alert("There was an error submitting the meeting summary.");

0 commit comments

Comments
 (0)