feat(realtime): add voice/video recording activity events
Some checks are pending
CI / test (push) Has started running
Some checks are pending
CI / test (push) Has started running
This commit is contained in:
@@ -46,6 +46,8 @@ export function MessageList() {
|
||||
const activeChatId = useChatStore((s) => s.activeChatId);
|
||||
const messagesByChat = useChatStore((s) => s.messagesByChat);
|
||||
const typingByChat = useChatStore((s) => s.typingByChat);
|
||||
const recordingVoiceByChat = useChatStore((s) => s.recordingVoiceByChat);
|
||||
const recordingVideoByChat = useChatStore((s) => s.recordingVideoByChat);
|
||||
const hasMoreByChat = useChatStore((s) => s.hasMoreByChat);
|
||||
const loadingMoreByChat = useChatStore((s) => s.loadingMoreByChat);
|
||||
const loadMoreMessages = useChatStore((s) => s.loadMoreMessages);
|
||||
@@ -130,6 +132,17 @@ export function MessageList() {
|
||||
const focusedMessageId = activeChatId ? (focusedMessageIdByChat[activeChatId] ?? null) : null;
|
||||
const hasMore = Boolean(activeChatId && hasMoreByChat[activeChatId]);
|
||||
const isLoadingMore = Boolean(activeChatId && loadingMoreByChat[activeChatId]);
|
||||
const typingCount = activeChatId ? (typingByChat[activeChatId] ?? []).length : 0;
|
||||
const recordingVoiceCount = activeChatId ? (recordingVoiceByChat[activeChatId] ?? []).length : 0;
|
||||
const recordingVideoCount = activeChatId ? (recordingVideoByChat[activeChatId] ?? []).length : 0;
|
||||
const activityLabel =
|
||||
recordingVideoCount > 0
|
||||
? "recording video..."
|
||||
: recordingVoiceCount > 0
|
||||
? "recording voice..."
|
||||
: typingCount > 0
|
||||
? "typing..."
|
||||
: "";
|
||||
const selectedMessages = useMemo(() => messages.filter((m) => selectedIds.has(m.id)), [messages, selectedIds]);
|
||||
const channelOnlyDeleteForAll = activeChat?.type === "channel" && !activeChat?.is_saved;
|
||||
const canDeleteAllForSelection = useMemo(
|
||||
@@ -683,7 +696,7 @@ export function MessageList() {
|
||||
})}
|
||||
</div>
|
||||
|
||||
<div className="px-5 pb-2 text-xs text-slate-300/80">{(typingByChat[activeChatId] ?? []).length > 0 ? "typing..." : ""}</div>
|
||||
<div className="px-5 pb-2 text-xs text-slate-300/80">{activityLabel}</div>
|
||||
{showScrollToBottom ? (
|
||||
<div className="pointer-events-none absolute bottom-20 right-4 z-40 md:bottom-24">
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user