File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -247,9 +247,16 @@ export const useChatStore = defineStore('chat', () => {
247247 const threadIds = Object . keys ( threadIdSetsToUpdate )
248248 if ( threadIds . length ) {
249249 const chatBlockWithMergeBy : Set < number > | undefined = chatBlocks [ token ] ?. find ( ( set ) => set . has ( options . mergeBy ! ) )
250+ const lastKnownId = getLastKnownId ( token )
250251 if ( chatBlockWithMergeBy ) {
251- // Populate thread blocks from chat blocks
252252 threadIds . forEach ( ( threadId ) => {
253+ if ( options . mergeBy === lastKnownId && chatBlockWithMergeBy . size === 1 ) {
254+ // Fallback: This is either polling or posting new message in a thread view
255+ // with no other messages in main chat block
256+ threadIdSetsToUpdate [ threadId ] . add ( getLastKnownId ( token , { threadId } ) )
257+ return
258+ }
259+ // Populate thread blocks from chat blocks
253260 for ( const messageId of chatBlockWithMergeBy ) {
254261 const message = store . state . messagesStore . messages [ token ] [ messageId ]
255262 if ( message && message . threadId === + threadId ) {
You can’t perform that action at this time.
0 commit comments