parent
b83067d0ee
commit
9018ae3009
|
@ -6,6 +6,7 @@ import { RenderTextCallbackType } from '../../types/Util';
|
|||
import { isLinkSneaky } from '../../../js/modules/link_previews';
|
||||
import { updateConfirmModal } from '../../state/ducks/modalDialog';
|
||||
import { shell } from 'electron';
|
||||
import { MessageInteraction } from '../../interactions';
|
||||
|
||||
const linkify = LinkifyIt();
|
||||
|
||||
|
@ -85,10 +86,15 @@ export class Linkify extends React.Component<Props> {
|
|||
title: window.i18n('linkVisitWarningTitle'),
|
||||
message: window.i18n('linkVisitWarningMessage', url),
|
||||
okText: window.i18n('open'),
|
||||
cancelText: window.i18n('copy'),
|
||||
onClickOk: openLink,
|
||||
onClickClose: () => {
|
||||
window.inboxStore?.dispatch(updateConfirmModal(null));
|
||||
},
|
||||
|
||||
onClickCancel: () => {
|
||||
MessageInteraction.copyBodyToClipboard(url);
|
||||
},
|
||||
})
|
||||
);
|
||||
};
|
||||
|
|
|
@ -16,6 +16,7 @@ export interface SessionConfirmDialogProps {
|
|||
onClose?: any;
|
||||
onClickOk?: () => Promise<void> | void;
|
||||
onClickClose?: () => any;
|
||||
onClickCancel?: () => any;
|
||||
okText?: string;
|
||||
cancelText?: string;
|
||||
hideCancel?: boolean;
|
||||
|
@ -40,6 +41,7 @@ const SessionConfirmInner = (props: SessionConfirmDialogProps) => {
|
|||
sessionIcon,
|
||||
iconSize,
|
||||
shouldShowConfirm,
|
||||
onClickCancel,
|
||||
} = props;
|
||||
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
@ -75,6 +77,10 @@ const SessionConfirmInner = (props: SessionConfirmDialogProps) => {
|
|||
* Performs specified on close action then removes the modal.
|
||||
*/
|
||||
const onClickCancelHandler = () => {
|
||||
if (onClickCancel) {
|
||||
onClickCancel();
|
||||
}
|
||||
|
||||
if (onClickClose) {
|
||||
onClickClose();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue