(threadKey: string, state: ThreadPreviewState)
| 81 | const changedPreviewThreadKeys = new Set<string>(); |
| 82 | |
| 83 | function syncActivePreviewThread(threadKey: string, state: ThreadPreviewState): void { |
| 84 | const active = Object.keys(state.sessions).length > 0; |
| 85 | appAtomRegistry.update(activePreviewThreadKeysAtom, (current) => { |
| 86 | if (current.keys.has(threadKey) === active) return current; |
| 87 | const next = new Set(current.keys); |
| 88 | if (active) next.add(threadKey); |
| 89 | else next.delete(threadKey); |
| 90 | return { keys: next }; |
| 91 | }); |
| 92 | } |
| 93 | |
| 94 | function updateThreadPreviewState( |
| 95 | ref: ScopedThreadRef, |
no test coverage detected