Bot Buttons: Follow-up (#2496)

This commit is contained in:
Alexander Zinchuk 2023-02-04 03:02:54 +01:00
parent 16efb72773
commit 6ed460c1e5

View File

@ -62,6 +62,7 @@ import {
isChatAdmin,
isChatSuperGroup,
isChatChannel,
isUserId,
} from '../../../global/helpers';
import { formatMediaDuration, formatVoiceRecordDuration } from '../../../util/dateFormat';
import focusEditableElement from '../../../util/focusEditableElement';
@ -1526,7 +1527,9 @@ export default memo(withGlobal<OwnProps>(
const chatBot = chatId !== REPLIES_USER_ID ? selectChatBot(global, chatId) : undefined;
const isChatWithBot = Boolean(chatBot);
const isChatWithSelf = selectIsChatWithSelf(global, chatId);
const messageWithActualBotKeyboard = selectNewestMessageWithBotKeyboardButtons(global, chatId, threadId);
const isChatWithUser = isUserId(chatId);
const messageWithActualBotKeyboard = (isChatWithBot || !isChatWithUser)
&& selectNewestMessageWithBotKeyboardButtons(global, chatId, threadId);
const scheduledIds = selectScheduledIds(global, chatId, threadId);
const { language, shouldSuggestStickers, shouldSuggestCustomEmoji } = global.settings.byKey;
const baseEmojiKeywords = global.emojiKeywords[BASE_EMOJI_KEYWORD_LANG];