From 8166aeb58db24642eed1140e16b1f3930b294009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=BC=E3=83=BC=E3=83=AC?= Date: Wed, 7 May 2025 18:00:32 +0500 Subject: [PATCH] Update profile.js --- api/v1/src/profile.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/api/v1/src/profile.js b/api/v1/src/profile.js index ea72df4..0db1f72 100644 --- a/api/v1/src/profile.js +++ b/api/v1/src/profile.js @@ -18,14 +18,17 @@ async function getProfileFromAnixart(profileId, token = '') { const verifiedResponse = await axios.get('https://anixart.seele.su/api/is_verified'); const verifiedList = verifiedResponse.data; - if (Array.isArray(verifiedList) && verifiedList.includes(profileId.toString())) { + const alreadyVerified = !!profileData.profile.is_verified; + + if (!alreadyVerified && Array.isArray(verifiedList) && verifiedList.includes(profileId.toString())) { profileData.profile.is_verified = true; - } else { + } + // Если уже верифицирован — не затираем + } catch { + // Если профиль уже верифицирован — оставляем, иначе false + if (typeof profileData.profile.is_verified !== 'boolean') { profileData.profile.is_verified = false; } - } catch { - // Ошибку верификации игнорируем - profileData.profile.is_verified = false; } // Подгружаем кастомные роли