diff --git a/public/js/views/profile.js b/public/js/views/profile.js index 8ced81e..91f134f 100644 --- a/public/js/views/profile.js +++ b/public/js/views/profile.js @@ -307,8 +307,11 @@ const UserProfileView = { msgBtn.textContent = '⏳ Открываем…'; try { const r = await API.ChatApi.ensureChat(this.userId); - const cid = r.chat_id || r.chat?.id; - if (!cid) throw new Error('chat not created'); + const cid = r.chat_id || r.chat?.id || r.id; + if (!cid) { + console.error('[UserProfile] no chat id in response', r); + throw new Error('chat not created'); + } App.openChat(cid, this.userId, u.name); } catch (e) { msgBtn.className = 'btn-b err';