diff options
author | 2021-05-12 01:26:51 +0530 | |
---|---|---|
committer | 2021-05-11 21:56:51 +0200 | |
commit | 80d7ef19dbb4271416bd8b5bbf938e180c57e5f3 (patch) | |
tree | ec99db3b3b0727d7ac81c1ead70e17db0c1bb6b3 /src/index.js | |
parent | Fixing issue with icons being garbled due to misconfiguration of gulp (diff) | |
download | ferdium-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.js | 7 |
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'; |
52 | import { asarPath } from './helpers/asar-helpers'; | 52 | import { asarPath } from './helpers/asar-helpers'; |
53 | import { isValidExternalURL } from './helpers/url-helpers'; | 53 | import { isValidExternalURL } from './helpers/url-helpers'; |
54 | import userAgent from './helpers/userAgent-helpers'; | 54 | import userAgent, { ferdiVersion } from './helpers/userAgent-helpers'; |
55 | 55 | ||
56 | const osName = require('os-name'); | ||
56 | const debug = require('debug')('Ferdi:App'); | 57 | const 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 | ||
164 | app.setAboutPanelOptions({ | 165 | app.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`, |