Skip to content

Commit f7a7a62

Browse files
committed
fix search
1 parent c97250b commit f7a7a62

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

app/api/repo/route.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ export async function GET() {
66
method: 'GET',
77
headers: {
88
"Authorization": process.env.SECRET_TOKEN!,
9-
}
9+
},
10+
cache: "no-cache"
1011
})
1112

1213
if (!result.ok) {

app/components/Input.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,16 @@ export default function Input({ value, onValueChange, handleSubmit, graph, icon,
170170
const label = option.labels[0]
171171
const name = option.properties.name
172172
const path = option.properties.path
173-
const colorName = getCategoryColorName(graph.CategoriesMap.get(label)!.index)
174-
const color = getCategoryColorValue(graph.CategoriesMap.get(label)!.index)
173+
let category = graph.CategoriesMap.get(label)
174+
175+
if (!category) {
176+
category = { name: label, index: graph.CategoriesMap.size, show: true }
177+
graph.CategoriesMap.set(label, category)
178+
graph.Categories.push(category)
179+
}
180+
181+
const colorName = getCategoryColorName(category.index)
182+
const color = getCategoryColorValue(category.index)
175183
return (
176184
<button
177185
className={cn(

0 commit comments

Comments
 (0)