Skip to content

Commit

Permalink
Remove error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Aayush-Agnihotri committed Dec 6, 2024
1 parent c835d4b commit 5d04e33
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/app/components/ChatHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ export default function ChatHeader() {
const [activeModels, setActiveModels] = useState<string[]>([]);
const modelDropdownRef = useRef<HTMLDivElement>(null);

const openModelDropdown = () => {
const openModelDropdown = async () => {
setLoading(true);
fetchAllModels();
fetchActiveModels();
setModelDropdownOpen(!modelDropdownOpen);
await fetchAllModels();
await fetchActiveModels();
setModelDropdownOpen(true);
setLoading(false);
}

Expand Down
6 changes: 3 additions & 3 deletions src/app/utils/requestUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export async function cloneRequest(request: NextRequest, url: string) {
try {
const clonedResponse = await fetch(`${process.env.OLLAMA_ENDPOINT}${url}`, init);

if (!clonedResponse.ok || !clonedResponse.body) {
return NextResponse.json({ error: `Ollama API error: ${clonedResponse.statusText}` }, { status: clonedResponse.status });
}
// if (!clonedResponse.ok || !clonedResponse.body) {
// return NextResponse.json({ error: `Ollama API error: ${clonedResponse.statusText}` }, { status: clonedResponse.status });
// }

const headers = new Headers(clonedResponse.headers);
const contentType = clonedResponse.headers.get('Content-Type');
Expand Down

0 comments on commit 5d04e33

Please sign in to comment.