mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-11 01:16:09 +00:00
context-menu: Add option to copy zulip url.
Added, "copy Zulip URL" in * Context menu in left sidebar * Application menu item Fixes: #649.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const { ipcRenderer, remote } = require('electron');
|
||||
const { ipcRenderer, remote, clipboard } = require('electron');
|
||||
const isDev = require('electron-is-dev');
|
||||
|
||||
const { session, app, Menu, dialog } = remote;
|
||||
@@ -535,6 +535,12 @@ class ServerManagerView {
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'Copy Zulip URL',
|
||||
click: () => {
|
||||
clipboard.writeText(DomainUtil.getDomain(index).url);
|
||||
}
|
||||
}
|
||||
];
|
||||
const contextMenu = Menu.buildFromTemplate(template);
|
||||
@@ -724,6 +730,10 @@ class ServerManagerView {
|
||||
ipcRenderer.on('open-feedback-modal', () => {
|
||||
feedbackHolder.classList.add('show');
|
||||
});
|
||||
|
||||
ipcRenderer.on('copy-zulip-url', () => {
|
||||
clipboard.writeText(DomainUtil.getDomain(this.activeTabIndex).url);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user