Menu > Help > version copied to clipboard on click (#1944)
This commit is contained in:
parent
a49d748c16
commit
8ad949eedb
|
@ -3,7 +3,7 @@
|
|||
// See LICENSE.txt for license information.
|
||||
'use strict';
|
||||
|
||||
import {app, ipcMain, Menu, MenuItemConstructorOptions, MenuItem, session, shell, WebContents, webContents} from 'electron';
|
||||
import {app, ipcMain, Menu, MenuItemConstructorOptions, MenuItem, session, shell, WebContents, webContents, clipboard} from 'electron';
|
||||
|
||||
import {OPEN_TEAMS_DROPDOWN, SHOW_NEW_SERVER_MODAL} from 'common/communication';
|
||||
import {Config} from 'common/config';
|
||||
|
@ -267,12 +267,17 @@ export function createTemplate(config: Config) {
|
|||
});
|
||||
submenu.push(separatorItem);
|
||||
}
|
||||
submenu.push({
|
||||
|
||||
// eslint-disable-next-line no-undef
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
label: `Version ${app.getVersion()}${__HASH_VERSION__ ? ` commit: ${__HASH_VERSION__}` : ''}`,
|
||||
enabled: false,
|
||||
const version = `Version ${app.getVersion()}${__HASH_VERSION__ ? ` commit: ${__HASH_VERSION__}` : ''}`;
|
||||
submenu.push({
|
||||
label: version,
|
||||
enabled: true,
|
||||
click() {
|
||||
clipboard.writeText(version);
|
||||
},
|
||||
});
|
||||
|
||||
template.push({label: 'Hel&p', submenu});
|
||||
|
|
Loading…
Reference in a new issue