Attachment Modal: Add Send When Online (#5219)

This commit is contained in:
Alexander Zinchuk 2024-11-27 20:33:45 +04:00
parent 20732fac61
commit c91287635e
2 changed files with 8 additions and 0 deletions

View File

@ -1654,6 +1654,8 @@ const Composer: FC<OwnProps & StateProps> = ({
onRemoveSymbol={removeSymbolAttachmentModal}
onEmojiSelect={insertTextAndUpdateCursorAttachmentModal}
editingMessage={editingMessage}
onSendWhenOnline={handleSendWhenOnline}
canScheduleUntilOnline={canScheduleUntilOnline && !isViewOnceEnabled}
/>
<PollModal
isOpen={pollModal.isOpen}

View File

@ -85,6 +85,8 @@ export type OwnProps = {
onCustomEmojiSelect: (emoji: ApiSticker) => void;
onRemoveSymbol: VoidFunction;
onEmojiSelect: (emoji: string) => void;
canScheduleUntilOnline?: boolean;
onSendWhenOnline?: NoneToVoidFunction;
};
type StateProps = {
@ -140,6 +142,8 @@ const AttachmentModal: FC<OwnProps & StateProps> = ({
onCustomEmojiSelect,
onRemoveSymbol,
onEmojiSelect,
canScheduleUntilOnline,
onSendWhenOnline,
}) => {
// eslint-disable-next-line no-null/no-null
const ref = useRef<HTMLDivElement>(null);
@ -706,6 +710,8 @@ const AttachmentModal: FC<OwnProps & StateProps> = ({
onClose={handleContextMenuClose}
onCloseAnimationEnd={handleContextMenuHide}
isSavedMessages={isChatWithSelf}
onSendWhenOnline={onSendWhenOnline}
canScheduleUntilOnline={canScheduleUntilOnline}
/>
)}
</div>