From cf4976da2f5600a4ec4b9629c80ad860b35a6ee4 Mon Sep 17 00:00:00 2001 From: "alexei.dolgolyov" Date: Wed, 22 Apr 2026 01:29:44 +0300 Subject: [PATCH] fix(telegram): load chats/listeners before expanding to fix slide animation height --- frontend/src/routes/bots/TelegramBotTab.svelte | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/frontend/src/routes/bots/TelegramBotTab.svelte b/frontend/src/routes/bots/TelegramBotTab.svelte index 7088fa0..2d14a33 100644 --- a/frontend/src/routes/bots/TelegramBotTab.svelte +++ b/frontend/src/routes/bots/TelegramBotTab.svelte @@ -81,13 +81,14 @@ }; } - function toggleSection(botId: number, section: string) { + async function toggleSection(botId: number, section: string) { if (expandedSection[botId] === section) { expandedSection = { ...expandedSection, [botId]: '' }; return; } + if (section === 'chats' && !chats[botId]) await loadChats(botId); + else if (section === 'listeners' && !botListenerStatus[botId]) await loadListenerStatus(botId); expandedSection = { ...expandedSection, [botId]: section }; - if (section === 'chats') loadChats(botId); } async function loadChats(botId: number) { @@ -344,12 +345,14 @@
editBot(bot)} /> - syncCommands(bot.id)} disabled={modeChanging[bot.id]} /> remove(bot.id)} variant="danger" />