Peers: Fix properties not resetting (#5331)

This commit is contained in:
zubiden 2024-12-20 11:37:27 +01:00 committed by Alexander Zinchuk
parent b8a906ef2f
commit 724f50bb59
3 changed files with 7 additions and 7 deletions

View File

@ -23,7 +23,7 @@ import type {
ApiTopic,
} from '../../types';
import { omitUndefined, pick, pickTruthy } from '../../../util/iteratees';
import { pick, pickTruthy } from '../../../util/iteratees';
import { getServerTime, getServerTimeOffset } from '../../../util/serverTime';
import { addPhotoToLocalDb, addUserToLocalDb, serializeBytes } from '../helpers';
import { buildApiPhoto, buildApiUsernames, buildAvatarPhotoId } from './common';
@ -71,7 +71,7 @@ function buildApiChatFieldsFromPeerEntity(
const areProfilesShown = Boolean('signatureProfiles' in peerEntity && peerEntity.signatureProfiles);
const subscriptionUntil = 'subscriptionUntilDate' in peerEntity ? peerEntity.subscriptionUntilDate : undefined;
return omitUndefined<PeerEntityApiChatFields>({
return {
isMin,
hasPrivateLink,
areSignaturesShown,
@ -104,7 +104,7 @@ function buildApiChatFieldsFromPeerEntity(
emojiStatus,
boostLevel,
subscriptionUntil,
});
};
}
export function buildApiChatFromDialog(

View File

@ -6,7 +6,7 @@ import type { ChatListType, GlobalState } from '../types';
import { ARCHIVED_FOLDER_ID } from '../../config';
import { areDeepEqual } from '../../util/areDeepEqual';
import {
areSortedArraysEqual, buildCollectionByKey, omit, pick, unique,
areSortedArraysEqual, buildCollectionByKey, omit, omitUndefined, pick, unique,
} from '../../util/iteratees';
import { selectChatFullInfo } from '../selectors';
@ -310,7 +310,7 @@ function getUpdatedChat<T extends GlobalState>(
return undefined;
}
return updatedChat;
return omitUndefined(updatedChat);
}
export function updateChatListType<T extends GlobalState>(

View File

@ -5,7 +5,7 @@ import type { GlobalState, TabArgs, TabState } from '../types';
import { areDeepEqual } from '../../util/areDeepEqual';
import { getCurrentTabId } from '../../util/establishMultitabRole';
import { omit, unique } from '../../util/iteratees';
import { omit, omitUndefined, unique } from '../../util/iteratees';
import { MEMO_EMPTY_ARRAY } from '../../util/memo';
import { selectTabState } from '../selectors';
import { updateChat } from './chats';
@ -140,7 +140,7 @@ function getUpdatedUser(global: GlobalState, userId: string, userUpdate: Partial
return undefined;
}
return updatedUser;
return omitUndefined(updatedUser);
}
export function deleteContact<T extends GlobalState>(global: T, userId: string): T {