From 53bf382b84b9fd45ea941d86cc5764c5adb1a11b Mon Sep 17 00:00:00 2001 From: root Date: Fri, 21 Aug 2026 12:12:33 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20ensureChat=20=D0=BE=D1=82=D0=B2=D0=B5?= =?UTF-8?q?=D1=82=20{id,user=5Fa,user=5Fb},=20=D0=BD=D0=B5=20{chat=5Fid}?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/views/profile.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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';