mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-08 15:22:39 +02:00
Restore API-based comments and remove unstable live sync integration
This commit is contained in:
parent
f346726294
commit
3ab9cc8485
5 changed files with 22 additions and 55 deletions
|
|
@ -55,10 +55,15 @@ export function useChatMessagesLive(threadId: number | null) {
|
|||
// Transform raw messages to MessageRecord with author info
|
||||
return [...messagesData].map((msg): MessageRecord => {
|
||||
const author = msg.author_id ? memberMap.get(msg.author_id) : null;
|
||||
|
||||
const role = (typeof msg.role === "string" ? msg.role.toLowerCase() : msg.role) as
|
||||
| "user"
|
||||
| "assistant"
|
||||
| "system";
|
||||
return {
|
||||
id: msg.id,
|
||||
thread_id: msg.thread_id,
|
||||
role: msg.role,
|
||||
role,
|
||||
content: msg.content,
|
||||
created_at: msg.created_at,
|
||||
author_id: msg.author_id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue