aboutsummaryrefslogtreecommitdiffstats
path: root/src/index.js
diff options
context:
space:
mode:
authorLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-05-12 01:26:51 +0530
committerLibravatar GitHub <noreply@github.com>2021-05-11 21:56:51 +0200
commit80d7ef19dbb4271416bd8b5bbf938e180c57e5f3 (patch)
treeec99db3b3b0727d7ac81c1ead70e17db0c1bb6b3 /src/index.js
parentFixing issue with icons being garbled due to misconfiguration of gulp (diff)
downloadferdium-app-80d7ef19dbb4271416bd8b5bbf938e180c57e5f3.tar.gz
ferdium-app-80d7ef19dbb4271416bd8b5bbf938e180c57e5f3.tar.zst
ferdium-app-80d7ef19dbb4271416bd8b5bbf938e180c57e5f3.zip
Method reuse (#1379)
* Used already exported common functions to avoid the same logic being repeated. * Use a different package to retrieve the os-name for the 'About Dialog'.
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/index.js b/src/index.js
index a93040895..0fac386df 100644
--- a/src/index.js
+++ b/src/index.js
@@ -51,8 +51,9 @@ import {
51} from './config'; 51} from './config';
52import { asarPath } from './helpers/asar-helpers'; 52import { asarPath } from './helpers/asar-helpers';
53import { isValidExternalURL } from './helpers/url-helpers'; 53import { isValidExternalURL } from './helpers/url-helpers';
54import userAgent from './helpers/userAgent-helpers'; 54import userAgent, { ferdiVersion } from './helpers/userAgent-helpers';
55 55
56const osName = require('os-name');
56const debug = require('debug')('Ferdi:App'); 57const debug = require('debug')('Ferdi:App');
57 58
58// From Electron 9 onwards, app.allowRendererProcessReuse = true by default. This causes the app to crash on Windows due to the 59// From Electron 9 onwards, app.allowRendererProcessReuse = true by default. This causes the app to crash on Windows due to the
@@ -162,7 +163,7 @@ if (!settings.get('enableGPUAcceleration')) {
162} 163}
163 164
164app.setAboutPanelOptions({ 165app.setAboutPanelOptions({
165 applicationVersion: `Version: ${app.getVersion()}\nElectron: ${process.versions.electron}\nNode.js: ${process.version}\nPlatform: ${process.platform}\nArch: ${process.arch}\nBuild date: ${new Date(Number(buildInfo.timestamp))}\nGit SHA: ${buildInfo.gitHashShort}\nGit branch: ${buildInfo.gitBranch}`, 166 applicationVersion: `Version: ${ferdiVersion}\nElectron: ${process.versions.electron}\nNode.js: ${process.version}\nPlatform: ${osName()}\nArch: ${process.arch}\nBuild date: ${new Date(Number(buildInfo.timestamp))}\nGit SHA: ${buildInfo.gitHashShort}\nGit branch: ${buildInfo.gitBranch}`,
166 version: '', 167 version: '',
167}); 168});
168 169
@@ -394,7 +395,7 @@ app.on('ready', () => {
394 app.setAsDefaultProtocolClient('ferdi-dev'); 395 app.setAsDefaultProtocolClient('ferdi-dev');
395 } 396 }
396 397
397 if (process.platform === 'win32') { 398 if (isWindows) {
398 app.setUserTasks([{ 399 app.setUserTasks([{
399 program: process.execPath, 400 program: process.execPath,
400 arguments: `${isDevMode ? `${__dirname} ` : ''}--reset-window`, 401 arguments: `${isDevMode ? `${__dirname} ` : ''}--reset-window`,