diff --git a/packages/insomnia-app/app/main/window-utils.js b/packages/insomnia-app/app/main/window-utils.js index 124a04a71..e6c0d0cb5 100644 --- a/packages/insomnia-app/app/main/window-utils.js +++ b/packages/insomnia-app/app/main/window-utils.js @@ -7,8 +7,10 @@ import { changelogUrl, getAppLongName, getAppName, + getAppReleaseDate, getAppVersion, isDevelopment, + isLinux, isMac, MNEMONIC_SYM, } from '../common/constants'; @@ -292,59 +294,51 @@ export function createWindow() { ], }; - const aboutDetail = [ - `OS ${os.type()} ${os.arch()} ${os.release()}`, - `Version ${getAppLongName()} ${getAppVersion()}`, - `Shell ${process.versions.electron}`, - `Node ${process.versions.node}`, - `V8 ${process.versions.v8}`, - `Architecture ${process.arch}`, - Curl.getVersion(), - ].join('\n'); + const aboutMenuClickHandler = async () => { + const copy = 'Copy'; + const ok = 'OK'; - const aboutMsgOptions = { - type: 'info', - title: getAppName(), - message: getAppLongName(), - detail: aboutDetail, - noLink: true, + const buttons = isLinux() ? [copy, ok] : [ok, copy]; + + const detail = [ + `Version: ${getAppLongName()} ${getAppVersion()}`, + `Release date: ${getAppReleaseDate()}`, + `OS: ${os.type()} ${os.arch()} ${os.release()}`, + `Electron: ${process.versions.electron}`, + `Node: ${process.versions.node}`, + `V8: ${process.versions.v8}`, + `Architecture: ${process.arch}`, + `node-libcurl: ${Curl.getVersion()}`, + ].join('\n'); + + const msgBox = await dialog.showMessageBox({ + type: 'info', + title: getAppName(), + message: getAppLongName(), + detail, + buttons, + defaultId: buttons.indexOf(ok), + cancelId: buttons.indexOf(ok), + noLink: true, + }); + + if (msgBox.response === buttons.indexOf(copy)) { + clipboard.writeText(detail); + } }; if (isMac()) { applicationMenu.submenu.unshift( { label: `A${MNEMONIC_SYM}bout ${getAppName()}`, - click: async () => { - const buttons = ['OK', 'Copy']; - const msgBox = await dialog.showMessageBox({ - ...aboutMsgOptions, - buttons: buttons, - defaultId: buttons.indexOf('OK'), - cancelId: buttons.indexOf('OK'), - }); - - if (msgBox.response === buttons.indexOf('Copy')) { - clipboard.writeText(aboutDetail); - } - }, + click: aboutMenuClickHandler, }, { type: 'separator' }, ); } else { - helpMenu.submenu.unshift({ + helpMenu.submenu.push({ label: `${MNEMONIC_SYM}About`, - click: async () => { - const buttons = ['Copy', 'OK']; - const msgBox = await dialog.showMessageBox({ - ...aboutMsgOptions, - buttons: buttons, - defaultId: buttons.indexOf('OK'), - cancelId: buttons.indexOf('OK'), - }); - if (msgBox.response === buttons.indexOf('Copy')) { - clipboard.writeText(aboutDetail); - } - }, + click: aboutMenuClickHandler, }); } diff --git a/packages/insomnia-app/app/ui/components/modals/settings-modal.js b/packages/insomnia-app/app/ui/components/modals/settings-modal.js index 8c6cc33a4..e988951bc 100644 --- a/packages/insomnia-app/app/ui/components/modals/settings-modal.js +++ b/packages/insomnia-app/app/ui/components/modals/settings-modal.js @@ -13,12 +13,7 @@ import Plugins from '../settings/plugins'; import Theme from '../settings/theme'; import * as models from '../../../models/index'; import { Curl } from 'node-libcurl'; -import { - getAppName, - getAppVersion, - getAppReleaseDate, - isInsomnia, -} from '../../../common/constants'; +import { getAppName, getAppVersion, isInsomnia } from '../../../common/constants'; import Tooltip from '../tooltip'; import { setTheme } from '../../../plugins/misc'; import * as session from '../../../account/session'; @@ -104,7 +99,7 @@ class SettingsModal extends PureComponent { {getAppName()} Preferences -   –  v{getAppVersion()} ({getAppReleaseDate()}) +   –  v{getAppVersion()} diff --git a/packages/insomnia-app/webpack/webpack.config.electron.babel.js b/packages/insomnia-app/webpack/webpack.config.electron.babel.js index d26a006ec..827e87eb4 100644 --- a/packages/insomnia-app/webpack/webpack.config.electron.babel.js +++ b/packages/insomnia-app/webpack/webpack.config.electron.babel.js @@ -20,6 +20,7 @@ if (process.env.NODE_ENV === 'development') { 'process.env.APP_RENDER_URL': JSON.stringify(`http://localhost:${PORT}/renderer.html`), 'process.env.NODE_ENV': JSON.stringify('development'), 'process.env.INSOMNIA_ENV': JSON.stringify('development'), + 'process.env.RELEASE_DATE': JSON.stringify(new Date()), }), ]; } else {