( threadInfos: $ReadOnlyArray<T>, threadSearchResults: $ReadOnlyArray<string>, )
| 1436 | } |
| 1437 | |
| 1438 | function reorderThreadSearchResults<T: RawThreadInfo | ThreadInfo>( |
| 1439 | threadInfos: $ReadOnlyArray<T>, |
| 1440 | threadSearchResults: $ReadOnlyArray<string>, |
| 1441 | ): T[] { |
| 1442 | const privateThreads = []; |
| 1443 | const personalThreads = []; |
| 1444 | const otherThreads = []; |
| 1445 | const threadSearchResultsSet = new Set(threadSearchResults); |
| 1446 | for (const threadInfo of threadInfos) { |
| 1447 | if (!threadSearchResultsSet.has(threadInfo.id)) { |
| 1448 | continue; |
| 1449 | } |
| 1450 | if (threadTypeIsPrivate(threadInfo.type)) { |
| 1451 | privateThreads.push(threadInfo); |
| 1452 | } else if (threadTypeIsPersonal(threadInfo.type)) { |
| 1453 | personalThreads.push(threadInfo); |
| 1454 | } else { |
| 1455 | otherThreads.push(threadInfo); |
| 1456 | } |
| 1457 | } |
| 1458 | |
| 1459 | return [...privateThreads, ...personalThreads, ...otherThreads]; |
| 1460 | } |
| 1461 | |
| 1462 | function useAvailableThreadMemberActions( |
| 1463 | memberInfo: RelativeMemberInfo, |
no test coverage detected