Do a better job of not having the frontend lockup if the session doesn't exist

This commit is contained in:
perf3ct
2025-04-13 21:43:58 +00:00
parent 9a68155edc
commit e65c5ddd46
3 changed files with 71 additions and 53 deletions

View File

@@ -28,9 +28,9 @@ export async function createChatSession(): Promise<string | null> {
*/
export async function checkSessionExists(sessionId: string): Promise<boolean> {
try {
const sessionCheck = await server.get<any>(`llm/sessions/${sessionId}`);
const sessionCheck = await server.getWithSilentNotFound<any>(`llm/sessions/${sessionId}`);
return !!(sessionCheck && sessionCheck.id);
} catch (error) {
} catch (error: any) {
console.log(`Error checking session ${sessionId}:`, error);
return false;
}