fix(teamsbot): credential save when form visible, add debugMode merge

Made-with: Cursor
This commit is contained in:
ValueOn AG 2026-03-01 10:20:09 +01:00
parent 294710b415
commit 24de648252

View file

@ -127,8 +127,10 @@ export const TeamsbotDashboardView: React.FC = () => {
return; return;
} }
// userAccount with new credentials: always save to DB (backend loads from there) // userAccount with new/unsaved credentials: save to DB before starting
if (joinMode === 'userAccount' && showCredentialForm && credEmail && credPassword) { const needsSave = joinMode === 'userAccount' && !userAccount?.hasSavedCredentials && credEmail && credPassword;
const needsUpdate = joinMode === 'userAccount' && showCredentialForm && credEmail && credPassword;
if (needsSave || needsUpdate) {
try { try {
setSavingCredentials(true); setSavingCredentials(true);
await teamsbotApi.saveUserAccount(instanceId, credEmail, credPassword); await teamsbotApi.saveUserAccount(instanceId, credEmail, credPassword);