Confirmation box appearing on link paste but no functionality is changed yet.

pull/1703/head
Warrick Corfe-Tan 4 years ago
parent 4f8e455b38
commit 6393a4ff27

@ -115,11 +115,9 @@ const SessionConfirmInner = (props: SessionConfirmDialogProps) => {
</div>
<div className="session-modal__button-group">
{/* <SessionButton text={okText} buttonColor={okTheme} onClick={closeAfterClickOk ? onClickOk : onClickOkWithClose} /> */}
<SessionButton text={okText} buttonColor={okTheme} onClick={onClickOkHandler} />
{!hideCancel && (
// <SessionButton text={cancelText} buttonColor={closeTheme} onClick={onClickClose} />
<SessionButton
text={cancelText}
buttonColor={closeTheme}

@ -41,6 +41,8 @@ import { getMentionsInput } from '../../../state/selectors/mentionsInput';
import { useDispatch } from 'react-redux';
import { updateConfirmModal } from '../../../state/ducks/modalDialog';
import { SessionButtonColor } from '../SessionButton';
import { any } from 'underscore';
import { SessionConfirmDialogProps } from '../SessionConfirm';
export interface ReplyingToMessageProps {
convoId: string;
@ -91,6 +93,7 @@ interface Props {
showLeftPaneSection: (section: SectionType) => void;
showSettingsSection: (category: SessionSettingCategory) => void;
theme: DefaultTheme;
updateConfirmModal: (props: SessionConfirmDialogProps) => any;
}
interface State {
@ -235,6 +238,12 @@ export class SessionCompositionBox extends React.Component<Props, State> {
// message: window.i18n('linkPreviewsConfirmMessage'),
// okTheme: SessionButtonColor.Danger,
// }))
this.props.updateConfirmModal({
shouldShowConfirm: () => !window.getSettingValue('link-preview-setting'),
title: window.i18n('linkPreviewsTitle'),
message: window.i18n('linkPreviewsConfirmMessage'),
okTheme: SessionButtonColor.Danger,
})
}
}

@ -43,8 +43,6 @@ import { AddModeratorsDialog } from '../../conversation/ModeratorsAddDialog';
import { RemoveModeratorsDialog } from '../../conversation/ModeratorsRemoveDialog';
import { UpdateGroupNameDialog } from '../../conversation/UpdateGroupNameDialog';
import { UpdateGroupMembersDialog } from '../../conversation/UpdateGroupMembersDialog';
import { getOurNumber } from '../../../state/selectors/user';
import { useSelector } from 'react-redux';
import { InviteContactsDialog } from '../../conversation/InviteContactsDialog';
interface State {
@ -314,6 +312,7 @@ export class SessionConversation extends React.Component<Props, State> {
removeAttachment={this.removeAttachment}
onChoseAttachments={this.onChoseAttachments}
theme={this.props.theme}
updateConfirmModal={actions.updateConfirmModal}
/>
</div>

Loading…
Cancel
Save