Link preview confirmation dialog working.

pull/1703/head
Warrick Corfe-Tan 4 years ago
parent e27e299f14
commit 15afdbfa7d

@ -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();

@ -250,6 +250,9 @@ export class SessionCompositionBox extends React.Component<Props, State> {
title: window.i18n('linkPreviewsTitle'),
message: window.i18n('linkPreviewsConfirmMessage'),
okTheme: SessionButtonColor.Danger,
onClickOk: () => {
window.setSettingValue('link-preview-setting', true);
}
});
}
}

Loading…
Cancel
Save