fix: refresh voice config only on chat lifecycle
This commit is contained in:
@@ -15,6 +15,7 @@ import type { ChatMessage as ApiMessage, ChatSession, PeriodicReport, PracticeRe
|
||||
const user = ref<UserProfile | null>(null);
|
||||
const sessions = ref<ChatSession[]>([]);
|
||||
const activeSessionId = ref<number | null>(null);
|
||||
const composerKey = ref(0);
|
||||
const messages = ref<DisplayMessage[]>([]);
|
||||
const drawerOpen = ref(false);
|
||||
const sending = ref(false);
|
||||
@@ -127,6 +128,7 @@ async function loadSessions() {
|
||||
|
||||
async function createSession() {
|
||||
if (sessionOperationPending.value) return;
|
||||
composerKey.value += 1;
|
||||
const existingBlank = sessions.value.find((session) => session.messageCount === 0);
|
||||
if (existingBlank) {
|
||||
await selectSession(existingBlank.id);
|
||||
@@ -643,7 +645,7 @@ async function copyText(text: string) {
|
||||
@retry="retryMessage"
|
||||
@feedback="openFeedback"
|
||||
/>
|
||||
<ChatComposer :loading="sending" :disabled="!activeSessionId || loadingSession" @send="send" @stop="stop" />
|
||||
<ChatComposer :key="composerKey" :loading="sending" :disabled="!activeSessionId || loadingSession" @send="send" @stop="stop" />
|
||||
<SessionDrawer
|
||||
:open="drawerOpen"
|
||||
:sessions="sessions"
|
||||
|
||||
Reference in New Issue
Block a user