mirror of
https://github.com/zadam/trilium.git
synced 2025-11-04 20:36:13 +01:00
Do a better job of not having the frontend lockup if the session doesn't exist
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user