MCPcopy Create free account
hub / github.com/CommE2E/comm / threadHasSubchannels

Function threadHasSubchannels

lib/utils/drawer-utils.react.js:74–86  ·  view source on GitHub ↗
(
  threadInfo: ResolvedThreadInfo,
  childThreadInfosMap: {
    +[id: string]: $ReadOnlyArray<ResolvedThreadInfo>,
  },
)

Source from the content-addressed store, hash-verified

72}
73
74function threadHasSubchannels(
75 threadInfo: ResolvedThreadInfo,
76 childThreadInfosMap: {
77 +[id: string]: $ReadOnlyArray<ResolvedThreadInfo>,
78 },
79): boolean {
80 if (!childThreadInfosMap[threadInfo.id]?.length) {
81 return false;
82 }
83 return childThreadInfosMap[threadInfo.id].some(thread =>
84 threadIsChannel(thread),
85 );
86}
87
88function useAppendCommunitySuffix(
89 communities: $ReadOnlyArray<ResolvedThreadInfo>,

Callers 1

Calls 1

threadIsChannelFunction · 0.90

Tested by

no test coverage detected