mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-10-23 03:31:56 +00:00
committed by
Akash Nimare
parent
01926e1234
commit
bda0dd29df
@@ -5,6 +5,7 @@ const {clipboard, Menu} = remote;
|
||||
export const contextMenu = (webContents: Electron.WebContents, event: Event, props: ContextMenuParams) => {
|
||||
const isText = Boolean(props.selectionText.length);
|
||||
const isLink = Boolean(props.linkURL);
|
||||
const isEmailAddress = Boolean(props.linkURL.startsWith('mailto:'));
|
||||
|
||||
const makeSuggestion = (suggestion: string) => ({
|
||||
label: suggestion,
|
||||
@@ -55,12 +56,12 @@ export const contextMenu = (webContents: Electron.WebContents, event: Event, pro
|
||||
}, {
|
||||
type: 'separator'
|
||||
}, {
|
||||
label: t.__('Copy Link'),
|
||||
visible: isText && isLink,
|
||||
label: isEmailAddress ? t.__('Copy Email Address') : t.__('Copy Link'),
|
||||
visible: isLink,
|
||||
click(_item) {
|
||||
clipboard.write({
|
||||
bookmark: props.linkText,
|
||||
text: props.linkURL
|
||||
text: isEmailAddress ? props.linkText : props.linkURL
|
||||
});
|
||||
}
|
||||
}, {
|
||||
|
Reference in New Issue
Block a user