Chat Info: Fix user status refetch after reload (#6326)
This commit is contained in:
parent
d9485ee326
commit
789dec658c
@ -67,6 +67,7 @@ export async function fetchFullUser({
|
|||||||
|
|
||||||
const fullInfo = buildApiUserFullInfo(result);
|
const fullInfo = buildApiUserFullInfo(result);
|
||||||
const users = result.users.map(buildApiUser).filter(Boolean);
|
const users = result.users.map(buildApiUser).filter(Boolean);
|
||||||
|
const userStatusesById = buildApiUserStatuses(result.users);
|
||||||
const chats = result.chats.map((c) => buildApiChatFromPreview(c)).filter(Boolean);
|
const chats = result.chats.map((c) => buildApiChatFromPreview(c)).filter(Boolean);
|
||||||
|
|
||||||
const user = users.find(({ id: userId }) => userId === id)!;
|
const user = users.find(({ id: userId }) => userId === id)!;
|
||||||
@ -83,6 +84,7 @@ export async function fetchFullUser({
|
|||||||
fullInfo,
|
fullInfo,
|
||||||
users,
|
users,
|
||||||
chats,
|
chats,
|
||||||
|
userStatusesById,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -74,6 +74,7 @@ addActionHandler('loadFullUser', async (global, actions, payload): Promise<void>
|
|||||||
global = updateUserFullInfo(global, userId, result.fullInfo);
|
global = updateUserFullInfo(global, userId, result.fullInfo);
|
||||||
global = updateUsers(global, buildCollectionByKey(result.users, 'id'));
|
global = updateUsers(global, buildCollectionByKey(result.users, 'id'));
|
||||||
global = updateChats(global, buildCollectionByKey(result.chats, 'id'));
|
global = updateChats(global, buildCollectionByKey(result.chats, 'id'));
|
||||||
|
global = addUserStatuses(global, result.userStatusesById);
|
||||||
|
|
||||||
setGlobal(global);
|
setGlobal(global);
|
||||||
if (withPhotos || (profilePhotos?.count && hasChangedPhoto)) {
|
if (withPhotos || (profilePhotos?.count && hasChangedPhoto)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user