add oauth app connected

This commit is contained in:
lendry
2026-06-26 10:49:34 +03:00
parent d5e6b58955
commit b81c0cedbb
18 changed files with 838 additions and 59 deletions

View File

@@ -364,9 +364,11 @@ export function FamilyGroupView({ groupId }: { groupId: string }) {
const loadMessages = useCallback(async (roomId: string) => {
if (!token || isPinLocked) return;
const room = rooms.find((item) => item.id === roomId);
if (room?.type === 'BOT') return;
const response = await fetchChatMessages(roomId, token);
setMessages((response.messages ?? []).filter((message) => !message.isDeleted));
}, [isPinLocked, token]);
}, [isPinLocked, rooms, token]);
const loadPresence = useCallback(async () => {
if (!token || isPinLocked) return;
@@ -473,7 +475,7 @@ export function FamilyGroupView({ groupId }: { groupId: string }) {
if (event.type === 'chat_message') {
if (payload?.message) {
appendMessage(payload.message as ChatMessage);
} else if (activeRoomId) {
} else if (activeRoomId && !activeRoomIsBot) {
void loadMessages(activeRoomId);
}
void loadGroup();
@@ -489,7 +491,7 @@ export function FamilyGroupView({ groupId }: { groupId: string }) {
} else {
setMessages((current) => current.map((item) => (item.id === updated.id ? updated : item)));
}
} else if (activeRoomId) {
} else if (activeRoomId && !activeRoomIsBot) {
void loadMessages(activeRoomId);
}
void loadGroup();
@@ -504,14 +506,14 @@ export function FamilyGroupView({ groupId }: { groupId: string }) {
if (editingMessageId === deleted.id) {
cancelEditMessage();
}
} else if (activeRoomId) {
} else if (activeRoomId && !activeRoomIsBot) {
void loadMessages(activeRoomId);
}
void loadGroup();
return;
}
if (event.type === 'chat_read_receipt' && activeRoomId) {
if (event.type === 'chat_read_receipt' && activeRoomId && !activeRoomIsBot) {
if (readReceiptTimerRef.current) clearTimeout(readReceiptTimerRef.current);
readReceiptTimerRef.current = setTimeout(() => void loadMessages(activeRoomId), 400);
return;
@@ -1854,7 +1856,12 @@ export function FamilyGroupView({ groupId }: { groupId: string }) {
}}
onConfirm={() => void confirmDeleteMessages()}
/>
<BotMiniAppSheet url={miniAppUrl} title={miniAppTitle} onClose={() => setMiniAppUrl(null)} />
<BotMiniAppSheet
url={miniAppUrl}
title={miniAppTitle}
authToken={token}
onClose={() => setMiniAppUrl(null)}
/>
<Dialog open={familyMembersOpen} onOpenChange={setFamilyMembersOpen}>
<DialogContent className="rounded-[28px] sm:max-w-[480px]">