Julius MarmingeT3 Code Mobile [WIP] (#2013)b3e8c035 months agoHistory
33 lines · 1.0 KB · TypeScript
RawDownload
interface TerminalUiRetentionThread {  key: string;  deletedAt: string | null;  archivedAt: string | null;} interface CollectActiveTerminalUiThreadKeysInput {  snapshotThreads: readonly TerminalUiRetentionThread[];  draftThreadKeys: Iterable<string>;} export function collectActiveTerminalUiThreadKeys(  input: CollectActiveTerminalUiThreadKeysInput,): Set<string> {  const activeThreadKeys = new Set<string>();  const snapshotThreadById = new Map(input.snapshotThreads.map((thread) => [thread.key, thread]));  for (const thread of input.snapshotThreads) {    if (thread.deletedAt !== null) continue;    if (thread.archivedAt !== null) continue;    activeThreadKeys.add(thread.key);  }  for (const draftThreadKey of input.draftThreadKeys) {    const snapshotThread = snapshotThreadById.get(draftThreadKey);    if (      snapshotThread &&      (snapshotThread.deletedAt !== null || snapshotThread.archivedAt !== null)    ) {      continue;    }    activeThreadKeys.add(draftThreadKey);  }  return activeThreadKeys;}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t