app: wrap provider data in Map to avoid store (#28765)

This commit is contained in:
Brendan Allan
2026-05-22 12:23:16 +08:00
committed by GitHub
parent 9f06accfb4
commit 1f0390cfbb
18 changed files with 80 additions and 55 deletions

View File

@@ -1063,7 +1063,7 @@ export function UserMessageDisplay(props: { message: UserMessage; parts: PartTyp
const providerID = props.message.model?.providerID
const modelID = props.message.model?.modelID
if (!providerID || !modelID) return ""
const match = data.store.provider?.all?.find((p) => p.id === providerID)
const match = data.store.provider?.all?.get(providerID)
return match?.models?.[modelID]?.name ?? modelID
})
const timefmt = createMemo(() => new Intl.DateTimeFormat(i18n.locale(), { timeStyle: "short" }))
@@ -1458,7 +1458,7 @@ PART_MAPPING["text"] = function TextPartDisplay(props) {
const model = createMemo(() => {
if (props.message.role !== "assistant") return ""
const message = props.message as AssistantMessage
const match = data.store.provider?.all?.find((p) => p.id === message.providerID)
const match = data.store.provider?.all?.get(message.providerID)
return match?.models?.[message.modelID]?.name ?? message.modelID
})