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>
<div className="session-modal__button-group"> <div className="session-modal__button-group">
{/* <SessionButton text={okText} buttonColor={okTheme} onClick={closeAfterClickOk ? onClickOk : onClickOkWithClose} /> */}
<SessionButton text={okText} buttonColor={okTheme} onClick={onClickOkHandler} /> <SessionButton text={okText} buttonColor={okTheme} onClick={onClickOkHandler} />
{!hideCancel && ( {!hideCancel && (
// <SessionButton text={cancelText} buttonColor={closeTheme} onClick={onClickClose} />
<SessionButton <SessionButton
text={cancelText} text={cancelText}
buttonColor={closeTheme} buttonColor={closeTheme}

@ -41,6 +41,8 @@ import { getMentionsInput } from '../../../state/selectors/mentionsInput';
import { useDispatch } from 'react-redux'; import { useDispatch } from 'react-redux';
import { updateConfirmModal } from '../../../state/ducks/modalDialog'; import { updateConfirmModal } from '../../../state/ducks/modalDialog';
import { SessionButtonColor } from '../SessionButton'; import { SessionButtonColor } from '../SessionButton';
import { any } from 'underscore';
import { SessionConfirmDialogProps } from '../SessionConfirm';
export interface ReplyingToMessageProps { export interface ReplyingToMessageProps {
convoId: string; convoId: string;
@ -91,6 +93,7 @@ interface Props {
showLeftPaneSection: (section: SectionType) => void; showLeftPaneSection: (section: SectionType) => void;
showSettingsSection: (category: SessionSettingCategory) => void; showSettingsSection: (category: SessionSettingCategory) => void;
theme: DefaultTheme; theme: DefaultTheme;
updateConfirmModal: (props: SessionConfirmDialogProps) => any;
} }
interface State { interface State {
@ -235,6 +238,12 @@ export class SessionCompositionBox extends React.Component<Props, State> {
// message: window.i18n('linkPreviewsConfirmMessage'), // message: window.i18n('linkPreviewsConfirmMessage'),
// okTheme: SessionButtonColor.Danger, // 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 { RemoveModeratorsDialog } from '../../conversation/ModeratorsRemoveDialog';
import { UpdateGroupNameDialog } from '../../conversation/UpdateGroupNameDialog'; import { UpdateGroupNameDialog } from '../../conversation/UpdateGroupNameDialog';
import { UpdateGroupMembersDialog } from '../../conversation/UpdateGroupMembersDialog'; import { UpdateGroupMembersDialog } from '../../conversation/UpdateGroupMembersDialog';
import { getOurNumber } from '../../../state/selectors/user';
import { useSelector } from 'react-redux';
import { InviteContactsDialog } from '../../conversation/InviteContactsDialog'; import { InviteContactsDialog } from '../../conversation/InviteContactsDialog';
interface State { interface State {
@ -314,6 +312,7 @@ export class SessionConversation extends React.Component<Props, State> {
removeAttachment={this.removeAttachment} removeAttachment={this.removeAttachment}
onChoseAttachments={this.onChoseAttachments} onChoseAttachments={this.onChoseAttachments}
theme={this.props.theme} theme={this.props.theme}
updateConfirmModal={actions.updateConfirmModal}
/> />
</div> </div>

Loading…
Cancel
Save