| 48 | | 47 | |
| 49 | export async function openWelcomeScreen() { | 48 | export async function openWelcomeScreen() { |
| 50 | const currentChatId = getCurrentChatId(); | 49 | const currentChatId = getCurrentChatId(); |
| 51 | if (currentChatId !== undefined) { | 50 | if (currentChatId !== undefined || chat.length > 0) { |
| 52 | return; | 51 | return; |
| 53 | } | 52 | } |
| 54 | | 53 | |
| 55 | await clearChat(); | | |
| 56 | chat.length = 0; | | |
| 57 | await sendWelcomePanel(); | 54 | await sendWelcomePanel(); |
| 58 | sendAssistantMessage(); | 55 | sendAssistantMessage(); |
| 59 | sendSystemMessage(system_message_types.WELCOME_PROMPT); | 56 | sendSystemMessage(system_message_types.WELCOME_PROMPT); |