diff --git a/ts/components/session/SessionConfirm.tsx b/ts/components/session/SessionConfirm.tsx index 62f55c0d9..606a26f05 100644 --- a/ts/components/session/SessionConfirm.tsx +++ b/ts/components/session/SessionConfirm.tsx @@ -39,12 +39,10 @@ const SessionConfirmInner = (props: SessionConfirmDialogProps) => { closeTheme = SessionButtonColor.Primary, onClickOk, onClickClose, - closeAfterClickOk = true, hideCancel = false, sessionIcon, iconSize, shouldShowConfirm, - // updateConfirmModal } = props; const okText = props.okText || window.i18n('ok'); @@ -55,19 +53,6 @@ const SessionConfirmInner = (props: SessionConfirmDialogProps) => { const messageSubText = messageSub ? 'session-confirm-main-message' : 'subtle'; - /** - * Calls close function after the ok button is clicked. If no close method specified, closes the modal - */ - const onClickOkWithClose = () => { - if (onClickOk) { - onClickOk(); - } - - if (onClickClose) { - onClickClose(); - } - }; - const onClickOkHandler = () => { if (onClickOk) { onClickOk(); @@ -80,6 +65,9 @@ const SessionConfirmInner = (props: SessionConfirmDialogProps) => { return null; } + /** + * Performs specified on close action then removes the modal. + */ const onClickCancelHandler = () => { if (onClickClose) { onClickClose(); diff --git a/ts/components/session/conversation/SessionCompositionBox.tsx b/ts/components/session/conversation/SessionCompositionBox.tsx index ce315adcd..c5341e22a 100644 --- a/ts/components/session/conversation/SessionCompositionBox.tsx +++ b/ts/components/session/conversation/SessionCompositionBox.tsx @@ -250,6 +250,9 @@ export class SessionCompositionBox extends React.Component { title: window.i18n('linkPreviewsTitle'), message: window.i18n('linkPreviewsConfirmMessage'), okTheme: SessionButtonColor.Danger, + onClickOk: () => { + window.setSettingValue('link-preview-setting', true); + } }); } }