From fa1b607026d17db11685ee2d4275f40c34d4d4de Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Sun, 20 Aug 2017 13:03:13 +0200 Subject: [PATCH] Show update channel in About window (#2102) * Show update channel in About window * Improved syntax --- app/menus/menu.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/menus/menu.js b/app/menus/menu.js index 71cde678..4f4493db 100644 --- a/app/menus/menu.js +++ b/app/menus/menu.js @@ -1,9 +1,9 @@ +// Packages const {app, dialog} = require('electron'); -const {getKeymaps} = require('../config'); +// Utilities +const {getKeymaps, getConfig} = require('../config'); const {icon} = require('../config/paths'); - -// menus const viewMenu = require('./menus/view'); const shellMenu = require('./menus/shell'); const editMenu = require('./menus/edit'); @@ -16,15 +16,20 @@ const appName = app.getName(); const appVersion = app.getVersion(); module.exports = (createWindow, updatePlugins, getLoadedPluginVersions) => { - const commands = getKeymaps().commands; + const config = getConfig(); + const {commands} = getKeymaps(); + + const updateChannel = config.canaryUpdates ? 'canary' : 'stable'; + const showAbout = () => { const loadedPlugins = getLoadedPluginVersions(); const pluginList = loadedPlugins.length === 0 ? 'none' : loadedPlugins.map(plugin => `\n ${plugin.name} (${plugin.version})`); + dialog.showMessageBox({ title: `About ${appName}`, - message: `${appName} ${appVersion}`, + message: `${appName} ${appVersion} (${updateChannel})`, detail: `Plugins: ${pluginList}\n\nCreated by Guillermo Rauch\nCopyright © 2017 Zeit, Inc.`, buttons: [], icon