mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-15 21:28:40 -09:00
Show update channel in About window (#2102)
* Show update channel in About window * Improved syntax
This commit is contained in:
parent
a0713f86e8
commit
fa1b607026
1 changed files with 10 additions and 5 deletions
|
|
@ -1,9 +1,9 @@
|
||||||
|
// Packages
|
||||||
const {app, dialog} = require('electron');
|
const {app, dialog} = require('electron');
|
||||||
|
|
||||||
const {getKeymaps} = require('../config');
|
// Utilities
|
||||||
|
const {getKeymaps, getConfig} = require('../config');
|
||||||
const {icon} = require('../config/paths');
|
const {icon} = require('../config/paths');
|
||||||
|
|
||||||
// menus
|
|
||||||
const viewMenu = require('./menus/view');
|
const viewMenu = require('./menus/view');
|
||||||
const shellMenu = require('./menus/shell');
|
const shellMenu = require('./menus/shell');
|
||||||
const editMenu = require('./menus/edit');
|
const editMenu = require('./menus/edit');
|
||||||
|
|
@ -16,15 +16,20 @@ const appName = app.getName();
|
||||||
const appVersion = app.getVersion();
|
const appVersion = app.getVersion();
|
||||||
|
|
||||||
module.exports = (createWindow, updatePlugins, getLoadedPluginVersions) => {
|
module.exports = (createWindow, updatePlugins, getLoadedPluginVersions) => {
|
||||||
const commands = getKeymaps().commands;
|
const config = getConfig();
|
||||||
|
const {commands} = getKeymaps();
|
||||||
|
|
||||||
|
const updateChannel = config.canaryUpdates ? 'canary' : 'stable';
|
||||||
|
|
||||||
const showAbout = () => {
|
const showAbout = () => {
|
||||||
const loadedPlugins = getLoadedPluginVersions();
|
const loadedPlugins = getLoadedPluginVersions();
|
||||||
const pluginList = loadedPlugins.length === 0 ?
|
const pluginList = loadedPlugins.length === 0 ?
|
||||||
'none' :
|
'none' :
|
||||||
loadedPlugins.map(plugin => `\n ${plugin.name} (${plugin.version})`);
|
loadedPlugins.map(plugin => `\n ${plugin.name} (${plugin.version})`);
|
||||||
|
|
||||||
dialog.showMessageBox({
|
dialog.showMessageBox({
|
||||||
title: `About ${appName}`,
|
title: `About ${appName}`,
|
||||||
message: `${appName} ${appVersion}`,
|
message: `${appName} ${appVersion} (${updateChannel})`,
|
||||||
detail: `Plugins: ${pluginList}\n\nCreated by Guillermo Rauch\nCopyright © 2017 Zeit, Inc.`,
|
detail: `Plugins: ${pluginList}\n\nCreated by Guillermo Rauch\nCopyright © 2017 Zeit, Inc.`,
|
||||||
buttons: [],
|
buttons: [],
|
||||||
icon
|
icon
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue