diff --git a/src/components/middle/composer/Composer.tsx b/src/components/middle/composer/Composer.tsx index d1ea5f57d..5149260e2 100644 --- a/src/components/middle/composer/Composer.tsx +++ b/src/components/middle/composer/Composer.tsx @@ -47,6 +47,7 @@ import { isUserId, isChatAdmin, isChatSuperGroup, + isChatChannel, } from '../../../modules/helpers'; import { formatMediaDuration, formatVoiceRecordDuration, getDayStartAt } from '../../../util/dateFormat'; import focusEditableElement from '../../../util/focusEditableElement'; @@ -121,6 +122,7 @@ type StateProps = draft?: ApiFormattedText; isChatWithBot?: boolean; isChatWithSelf?: boolean; + isChannel?: boolean; isRightColumnShown?: boolean; isSelectModeActive?: boolean; isForwarding?: boolean; @@ -185,6 +187,7 @@ const Composer: FC = ({ connectionState, isChatWithBot, isChatWithSelf, + isChannel, isRightColumnShown, isSelectModeActive, isForwarding, @@ -868,6 +871,7 @@ const Composer: FC = ({ /> @@ -1150,6 +1154,7 @@ export default memo(withGlobal( chat, isChatWithBot, isChatWithSelf, + isChannel: chat ? isChatChannel(chat) : undefined, canScheduleUntilOnline: Boolean( !isChatWithSelf && !isChatWithBot && chat && chatUser && isUserId(chatId) && selectUserStatus(global, chatId)?.wasOnline, diff --git a/src/components/middle/composer/PollModal.tsx b/src/components/middle/composer/PollModal.tsx index 1746197c5..67ef3cc4b 100644 --- a/src/components/middle/composer/PollModal.tsx +++ b/src/components/middle/composer/PollModal.tsx @@ -19,6 +19,7 @@ import './PollModal.scss'; export type OwnProps = { isOpen: boolean; + shouldBeAnonimous?: boolean; onSend: (pollSummary: ApiNewPoll) => void; onClear: () => void; }; @@ -29,7 +30,9 @@ const MAX_OPTION_LENGTH = 100; const MAX_QUESTION_LENGTH = 255; const MAX_SOLUTION_LENGTH = 200; -const PollModal: FC = ({ isOpen, onSend, onClear }) => { +const PollModal: FC = ({ + isOpen, shouldBeAnonimous, onSend, onClear, +}) => { // eslint-disable-next-line no-null/no-null const questionInputRef = useRef(null); // eslint-disable-next-line no-null/no-null @@ -313,11 +316,13 @@ const PollModal: FC = ({ isOpen, onSend, onClear }) => {
- + {!shouldBeAnonimous && ( + + )}