Skip to content

Function: syncThreadTabs()

syncThreadTabs(openIds, threads, activeThreadId?, seedMax?): string[]

Reconcile the open tabs against the current thread list and selection: drop tabs whose conversation no longer exists, seed from the newest conversations while the strip is empty, and always keep a tab for the active thread (a brand-new one isn’t in the server list yet, so it’s kept on the strength of being active alone).

Returns openIds itself when nothing changed, so a caller can drive this from an effect without looping on a fresh array every render.

string[]

ThreadSummary[]

string

number = THREAD_TAB_SEED_MAX

string[]