优化: 代码质量收尾(搜索索引补全+编译警告清理+i18n核验+String替newtype)
This commit is contained in:
@@ -12,7 +12,7 @@ import { persistUiState } from './useAiPanel'
|
||||
import { setStreaming } from './streamingGuard'
|
||||
import { nextMsgId, getConvState, clearConvStreamState, startApprovalTimer } from './aiShared'
|
||||
import { t } from '@/i18n/i18n-helpers'
|
||||
import type { AiConversationDetail, AiMessage, AiToolCallInfo } from '@/api/types'
|
||||
import type { AiConversationDetail, AiMessage, AiToolCallInfo, ConvId } from '@/api/types'
|
||||
|
||||
const appSettings = useAppSettingsStore()
|
||||
|
||||
@@ -28,7 +28,7 @@ async function loadConversations() {
|
||||
&& !state.conversations.some(c => c.id === state.activeConversationId)) {
|
||||
const now = String(Date.now())
|
||||
state.conversations.unshift({
|
||||
id: state.activeConversationId,
|
||||
id: state.activeConversationId as ConvId,
|
||||
title: null,
|
||||
provider_id: null,
|
||||
model: null,
|
||||
@@ -102,7 +102,7 @@ export async function switchConversation(id: string) {
|
||||
if (mySwitchId !== _latestSwitchId) return
|
||||
void appSettings.set('df-ai-active-conv', created.id)
|
||||
// 用新对话 id 重走后续逻辑
|
||||
detail = { id: created.id, title: null, messages: '[]' }
|
||||
detail = { id: created.id as ConvId, title: null, messages: '[]' }
|
||||
state.messages = []
|
||||
notifyConversationChanged()
|
||||
void loadConversations()
|
||||
|
||||
Reference in New Issue
Block a user