Chat Info: Fix user status refetch after reload (#6326)

This commit is contained in:
zubiden 2025-10-08 12:33:33 +02:00 committed by Alexander Zinchuk
parent d9485ee326
commit 789dec658c
2 changed files with 3 additions and 0 deletions

View File

@ -67,6 +67,7 @@ export async function fetchFullUser({
const fullInfo = buildApiUserFullInfo(result);
const users = result.users.map(buildApiUser).filter(Boolean);
const userStatusesById = buildApiUserStatuses(result.users);
const chats = result.chats.map((c) => buildApiChatFromPreview(c)).filter(Boolean);
const user = users.find(({ id: userId }) => userId === id)!;
@ -83,6 +84,7 @@ export async function fetchFullUser({
fullInfo,
users,
chats,
userStatusesById,
};
}

View File

@ -74,6 +74,7 @@ addActionHandler('loadFullUser', async (global, actions, payload): Promise<void>
global = updateUserFullInfo(global, userId, result.fullInfo);
global = updateUsers(global, buildCollectionByKey(result.users, 'id'));
global = updateChats(global, buildCollectionByKey(result.chats, 'id'));
global = addUserStatuses(global, result.userStatusesById);
setGlobal(global);
if (withPhotos || (profilePhotos?.count && hasChangedPhoto)) {