Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Fix about dialog version after other app actions
Browse files Browse the repository at this point in the history
Auditors: @aekeus
  • Loading branch information
bbondy committed Jan 30, 2016
1 parent 699c491 commit af10083
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 3 additions & 4 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ app.on('ready', function () {
BrowserWindow.getFocusedWindow().webContents.send(messages.STOP_LOAD)
})

Menu.init()

// Load HTTPS Everywhere browser "extension"
HttpsEverywhere.init()

Expand All @@ -151,11 +153,8 @@ app.on('ready', function () {
CrashHerald.init()

// This loads package.json into an object
// TODO: Seems like this can be done with app.getVersion() insteand?
PackageLoader.load((err, pack) => {
Menu.init({
version: pack.version
})

if (err) throw new Error('package.json could not be accessed')

// Setup the auto updater, check the env variable first because it's
Expand Down
3 changes: 2 additions & 1 deletion app/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const AppConfig = require('../js/constants/appConfig')
const Menu = require('menu')
const messages = require('../js/constants/messages')
const dialog = electron.dialog
const app = electron.app
const AppActions = require('../js/actions/appActions')
const CommonMenu = require('../js/commonMenu')
const Filtering = require('./filtering')
Expand Down Expand Up @@ -53,7 +54,7 @@ const init = (args) => {
click: (item, focusedWindow) => {
dialog.showMessageBox({
title: 'Brave',
message: 'Version: ' + args.version + '\n' +
message: 'Version: ' + app.getVersion() + '\n' +
'Electron: ' + process.versions['atom-shell'] + '\n' +
'libchromiumcontent: ' + process.versions['chrome'],
icon: path.join(__dirname, 'img', 'braveBtn.png'),
Expand Down

1 comment on commit af10083

@aekeus
Copy link
Member

@aekeus aekeus commented on af10083 Feb 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++ This makes sense to grab it from the app object directly

Please sign in to comment.