wu981526092 commited on
Commit
0585b20
·
1 Parent(s): 9105f68

Only create session when user sends first message - no empty sessions

Browse files
frontend/src/hooks/useChat.ts CHANGED
@@ -63,10 +63,8 @@ export function useChat(options: UseChatOptions = {}) {
63
  const currentSession = chatStorage.getCurrentSession()
64
  if (currentSession) {
65
  setCurrentSessionId(currentSession.id)
66
- } else if (loadedSessions.length > 0) {
67
- setCurrentSessionId(loadedSessions[0].id)
68
- chatStorage.setCurrentSession(loadedSessions[0].id)
69
  }
 
70
  }, [])
71
 
72
 
 
63
  const currentSession = chatStorage.getCurrentSession()
64
  if (currentSession) {
65
  setCurrentSessionId(currentSession.id)
 
 
 
66
  }
67
+ // Remove auto-selection of first session - let user start fresh
68
  }, [])
69
 
70
 
frontend/src/pages/Playground.tsx CHANGED
@@ -331,10 +331,7 @@ export function Playground() {
331
  loadSavedAssistants()
332
  }, [])
333
 
334
- // Auto-create new session on component mount
335
- useEffect(() => {
336
- createNewSession()
337
- }, [createNewSession])
338
 
339
  // Debug logs for Session issue
340
  useEffect(() => {
 
331
  loadSavedAssistants()
332
  }, [])
333
 
334
+
 
 
 
335
 
336
  // Debug logs for Session issue
337
  useEffect(() => {
static/assets/index-33c398eb.js ADDED
The diff for this file is too large to render. See raw diff
 
static/assets/index-33c398eb.js.map ADDED
The diff for this file is too large to render. See raw diff
 
static/index.html CHANGED
@@ -5,7 +5,7 @@
5
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
  <title>Edge LLM</title>
8
- <script type="module" crossorigin src="/assets/index-f82513d9.js"></script>
9
  <link rel="stylesheet" href="/assets/index-5451caa1.css">
10
  </head>
11
  <body>
 
5
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
  <title>Edge LLM</title>
8
+ <script type="module" crossorigin src="/assets/index-33c398eb.js"></script>
9
  <link rel="stylesheet" href="/assets/index-5451caa1.css">
10
  </head>
11
  <body>