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.
Parameters
Section titled “Parameters”openIds
Section titled “openIds”string[]
threads
Section titled “threads”activeThreadId?
Section titled “activeThreadId?”string
seedMax?
Section titled “seedMax?”number = THREAD_TAB_SEED_MAX
Returns
Section titled “Returns”string[]