mirror of
https://github.com/danog/telegram-tt.git
synced 2024-11-30 04:39:00 +01:00
[Perf] [Refactoring] Fix incorrect parsing of object conditional properties
This commit is contained in:
parent
a9eaa1a6d4
commit
5d6a0305b2
@ -344,10 +344,7 @@ export default memo(withGlobal<OwnProps>(
|
||||
chat,
|
||||
isMuted: selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global)),
|
||||
lastMessageSender,
|
||||
...(isOutgoing && { lastMessageOutgoingStatus: selectOutgoingStatus(global, chat.lastMessage) }),
|
||||
...(privateChatUserId && { privateChatUser: selectUser(global, privateChatUserId) }),
|
||||
actionTargetUserIds,
|
||||
...(actionTargetUserIds && { usersById }),
|
||||
actionTargetChatId,
|
||||
actionTargetMessage,
|
||||
draft: selectDraft(global, chatId, MAIN_THREAD_ID),
|
||||
@ -355,6 +352,9 @@ export default memo(withGlobal<OwnProps>(
|
||||
isSelected,
|
||||
canScrollDown: isSelected && messageListType === 'thread',
|
||||
lastSyncTime: global.lastSyncTime,
|
||||
...(isOutgoing && { lastMessageOutgoingStatus: selectOutgoingStatus(global, chat.lastMessage) }),
|
||||
...(privateChatUserId && { privateChatUser: selectUser(global, privateChatUserId) }),
|
||||
...(actionTargetUserIds && { usersById }),
|
||||
};
|
||||
},
|
||||
(setGlobal, actions): DispatchProps => pick(actions, [
|
||||
|
@ -231,14 +231,14 @@ export default memo(withGlobal<OwnProps>(
|
||||
chatsById,
|
||||
usersById,
|
||||
lastSyncTime,
|
||||
notifySettings: selectNotifySettings(global),
|
||||
notifyExceptions: selectNotifyExceptions(global),
|
||||
...(listType ? {
|
||||
listIds: listIds[listType],
|
||||
orderedPinnedIds: orderedPinnedIds[listType],
|
||||
} : {
|
||||
chatFolder,
|
||||
}),
|
||||
notifySettings: selectNotifySettings(global),
|
||||
notifyExceptions: selectNotifyExceptions(global),
|
||||
};
|
||||
},
|
||||
(setGlobal, actions): DispatchProps => pick(actions, [
|
||||
|
@ -137,8 +137,8 @@ export default memo(withGlobal<OwnProps>(
|
||||
|
||||
return {
|
||||
chat,
|
||||
...(privateChatUserId && { privateChatUser: selectUser(global, privateChatUserId) }),
|
||||
lastSyncTime: global.lastSyncTime,
|
||||
...(privateChatUserId && { privateChatUser: selectUser(global, privateChatUserId) }),
|
||||
};
|
||||
},
|
||||
(setGlobal, actions): DispatchProps => pick(actions, [
|
||||
|
@ -534,12 +534,12 @@ export default memo(withGlobal<OwnProps>(
|
||||
focusingId,
|
||||
hasFocusHighlight,
|
||||
isSelectModeActive: selectIsInSelectMode(global),
|
||||
...(withLastMessageWhenPreloading && { lastMessage }),
|
||||
botDescription,
|
||||
threadTopMessageId,
|
||||
hasLinkedChat: chat.fullInfo && ('linkedChatId' in chat.fullInfo)
|
||||
? Boolean(chat.fullInfo.linkedChatId)
|
||||
: undefined,
|
||||
...(withLastMessageWhenPreloading && { lastMessage }),
|
||||
};
|
||||
},
|
||||
(setGlobal, actions): DispatchProps => pick(actions, [
|
||||
|
@ -968,10 +968,7 @@ export default memo(withGlobal<OwnProps>(
|
||||
isThreadTop,
|
||||
replyMessage,
|
||||
replyMessageSender,
|
||||
...(isOutgoing && { outgoingStatus: selectOutgoingStatus(global, message, messageListType === 'scheduled') }),
|
||||
...(typeof uploadProgress === 'number' && { uploadProgress }),
|
||||
isFocused,
|
||||
...(isFocused && { focusDirection, noFocusHighlight }),
|
||||
isForwarding,
|
||||
isChatWithSelf,
|
||||
isChannel,
|
||||
@ -989,6 +986,9 @@ export default memo(withGlobal<OwnProps>(
|
||||
shouldAutoLoadMedia: chat ? selectShouldAutoLoadMedia(global, message, chat, sender) : undefined,
|
||||
shouldAutoPlayMedia: selectShouldAutoPlayMedia(global, message),
|
||||
shouldLoopStickers: selectShouldLoopStickers(global),
|
||||
...(isOutgoing && { outgoingStatus: selectOutgoingStatus(global, message, messageListType === 'scheduled') }),
|
||||
...(typeof uploadProgress === 'number' && { uploadProgress }),
|
||||
...(isFocused && { focusDirection, noFocusHighlight }),
|
||||
};
|
||||
},
|
||||
(setGlobal, actions): DispatchProps => pick(actions, [
|
||||
|
@ -459,15 +459,15 @@ export default memo(withGlobal<OwnProps>(
|
||||
areMembersHidden,
|
||||
canAddMembers,
|
||||
canDeleteMembers,
|
||||
...(hasMembersTab && members && {
|
||||
members,
|
||||
usersById,
|
||||
}),
|
||||
currentUserId: global.currentUserId,
|
||||
isRightColumnShown: selectIsRightColumnShown(global),
|
||||
isRestricted: chat && chat.isRestricted,
|
||||
lastSyncTime: global.lastSyncTime,
|
||||
serverTimeOffset: global.serverTimeOffset,
|
||||
...(hasMembersTab && members && {
|
||||
members,
|
||||
usersById,
|
||||
}),
|
||||
};
|
||||
},
|
||||
(setGlobal, actions): DispatchProps => pick(actions, [
|
||||
|
Loading…
Reference in New Issue
Block a user