({
threads,
topics,
pinnedThreads,
currentChannel,
currentCommunity,
settings,
channelName,
isSubDomainRouting,
token,
permissions,
currentThreadId,
pathCursor,
setThreads,
setTopics,
deleteMessage,
editThread,
muteThread,
unmuteThread,
pinThread,
starThread,
updateThreadResolution,
readThread,
unreadThread,
editMessage,
onMessage,
onDrop,
onShare,
onRemind,
onSelectThread,
updateThread,
sendReaction,
useUsersContext,
usePath,
routerPush,
api,
//startSignUp,
activeUsers,
}: Props)
| 137 | const UPDATE_READ_STATUS_INTERVAL_IN_MS = 30000; |
| 138 | |
| 139 | export default function Channel({ |
| 140 | threads, |
| 141 | topics, |
| 142 | pinnedThreads, |
| 143 | currentChannel, |
| 144 | currentCommunity, |
| 145 | settings, |
| 146 | channelName, |
| 147 | isSubDomainRouting, |
| 148 | token, |
| 149 | permissions, |
| 150 | currentThreadId, |
| 151 | pathCursor, |
| 152 | setThreads, |
| 153 | setTopics, |
| 154 | deleteMessage, |
| 155 | editThread, |
| 156 | muteThread, |
| 157 | unmuteThread, |
| 158 | pinThread, |
| 159 | starThread, |
| 160 | updateThreadResolution, |
| 161 | readThread, |
| 162 | unreadThread, |
| 163 | editMessage, |
| 164 | onMessage, |
| 165 | onDrop, |
| 166 | onShare, |
| 167 | onRemind, |
| 168 | onSelectThread, |
| 169 | updateThread, |
| 170 | sendReaction, |
| 171 | useUsersContext, |
| 172 | usePath, |
| 173 | routerPush, |
| 174 | api, |
| 175 | //startSignUp, |
| 176 | activeUsers, |
| 177 | }: Props) { |
| 178 | const [collapsed, setCollapsed] = useState(false); |
| 179 | const [isInfiniteScrollLoading, setInfiniteScrollLoading] = useState(false); |
| 180 | const [isLeftScrollAtBottom, setIsLeftScrollAtBottom] = useState(true); |
| 181 | const [isScrolling, setIsScrolling] = useState(true); |
| 182 | const [readStatus, setReadStatus] = useState<SerializedReadStatus>(); |
| 183 | const scrollableRootRef = useRef<HTMLDivElement | null>(null); |
| 184 | const lastScrollDistanceToBottomRef = useRef<number>(); |
| 185 | const rightRef = useRef<HTMLDivElement>(null); |
| 186 | const leftBottomRef = useRef<HTMLDivElement>(null); |
| 187 | const [error, setError] = useState<{ prev?: unknown; next?: unknown }>(); |
| 188 | const { mode } = useMode(); |
| 189 | const membersPath = usePath({ href: '/members' }); |
| 190 | const viewport = useViewport(); |
| 191 | |
| 192 | const currentUser = permissions.user || null; |
| 193 | |
| 194 | useLayoutEffect(() => { |
| 195 | if (!isInfiniteScrollLoading) { |
| 196 | scrollDown(); |
nothing calls this directly
no test coverage detected