mirror of
https://github.com/domfelipe/mika-agent-assist.git
synced 2026-08-07 15:36:49 +00:00
Changes
Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com>
This commit is contained in:
parent
09c5ca0c4f
commit
7bdf7730a7
1 changed files with 12 additions and 1 deletions
|
|
@ -81,11 +81,22 @@ function WelcomePage() {
|
||||||
}, [step]);
|
}, [step]);
|
||||||
|
|
||||||
// Se já completou o onboarding E já conectou o Telegram, vai direto para /painel.
|
// Se já completou o onboarding E já conectou o Telegram, vai direto para /painel.
|
||||||
// Se ainda não conectou o Telegram, mantém o usuário aqui na etapa 3 (managed bot).
|
// Se ainda não conectou o Telegram mas já tem nome do agente, pula direto para a etapa 3.
|
||||||
|
const jumpedToStep3 = useRef(false);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!agent) return;
|
if (!agent) return;
|
||||||
if (agent.onboarding_completed && agent.telegram_bot_token_vault_id) {
|
if (agent.onboarding_completed && agent.telegram_bot_token_vault_id) {
|
||||||
navigate({ to: "/painel", search: {} });
|
navigate({ to: "/painel", search: {} });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
!jumpedToStep3.current &&
|
||||||
|
agent.onboarding_completed &&
|
||||||
|
!agent.telegram_bot_token_vault_id &&
|
||||||
|
agent.agent_name
|
||||||
|
) {
|
||||||
|
jumpedToStep3.current = true;
|
||||||
|
setStep(3);
|
||||||
}
|
}
|
||||||
}, [agent, navigate]);
|
}, [agent, navigate]);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue