fix docker for tauri app

This commit is contained in:
lendry
2026-06-26 16:43:17 +03:00
parent f1068edc89
commit 3ab48d8537
11 changed files with 220 additions and 76 deletions

View File

@@ -46,6 +46,7 @@ interface FamilyBotChatProps {
botRef: string;
botName: string;
token: string | null;
roomId?: string;
className?: string;
inputPlaceholder?: string;
onOpenMiniApp?: (url: string) => void;
@@ -56,6 +57,7 @@ export function FamilyBotChat({
botRef,
botName,
token,
roomId,
className,
inputPlaceholder = 'Сообщение боту',
onOpenMiniApp,
@@ -98,7 +100,7 @@ export function FamilyBotChat({
if (!token) return;
setLoading(true);
try {
const response = await fetchBotChatMessages(botRef, token);
const response = await fetchBotChatMessages(botRef, token, roomId);
setMessages(response.messages ?? []);
const menuButton = resolveComposerMenuButton({
composerMenuButtonJson: response.composerMenuButtonJson,
@@ -119,7 +121,7 @@ export function FamilyBotChat({
} finally {
setLoading(false);
}
}, [botRef, onBotMetaChange, token]);
}, [botRef, onBotMetaChange, roomId, token]);
useEffect(() => {
void loadMessages();
@@ -240,7 +242,7 @@ export function FamilyBotChat({
}
]);
try {
await sendBotMessage(botRef, text, token);
await sendBotMessage(botRef, text, token, roomId);
await loadMessages();
} finally {
setSending(false);

View File

@@ -340,7 +340,7 @@ export function FamilyGroupView({ groupId }: { groupId: string }) {
const myMembership = activeRoom?.members.find((member) => member.userId === user?.id);
const isFamilyOwner = group?.ownerId === user?.id;
const isChatCreator = activeRoom?.createdById === user?.id;
const canManageChatMembers = Boolean(isFamilyOwner || isChatCreator);
const canManageChatMembers = Boolean(isFamilyOwner || isChatCreator || activeRoomIsBot);
const canManageActiveBot = Boolean(
activeRoomIsBot && botChatMeta?.manageWebAppUrl && user?.id && botChatMeta.botOwnerId === user.id
);
@@ -1518,6 +1518,7 @@ export function FamilyGroupView({ groupId }: { groupId: string }) {
botRef={activeRoom.botUsername}
botName={activeRoomTitle}
token={token}
roomId={activeRoom.id}
onBotMetaChange={setBotChatMeta}
onOpenMiniApp={(url) => {
setMiniAppTitle('Mini App');
@@ -2142,8 +2143,9 @@ export function FamilyGroupView({ groupId }: { groupId: string }) {
const presence = presenceByUserId.get(member.userId);
const canRemoveFromChat =
canManageChatMembers &&
activeRoom.type === 'GROUP' &&
(activeRoom.type === 'GROUP' || activeRoom.type === 'BOT') &&
member.userId !== user?.id &&
member.userId !== activeRoom.peerUserId &&
!(member.isChatCreator && !isFamilyOwner);
const canRemoveFromFamily = isFamilyOwner && member.familyRole !== 'owner' && familyMember;
@@ -2183,7 +2185,7 @@ export function FamilyGroupView({ groupId }: { groupId: string }) {
);
})}
</div>
{activeRoom?.type === 'GROUP' && familyMembersNotInRoom.length > 0 ? (
{(activeRoom?.type === 'GROUP' || activeRoom?.type === 'BOT') && familyMembersNotInRoom.length > 0 ? (
<Button className="mt-4 w-full rounded-xl" onClick={() => {
setMembersOpen(false);
setAddMembersOpen(true);