Skip to content

Commit 5e89e1a

Browse files
committed
Fix: Fixed version name change in main menu
1 parent 569b958 commit 5e89e1a

File tree

3 files changed

+5
-24
lines changed

3 files changed

+5
-24
lines changed

app/menus/darwin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"label": "ARC",
44
"submenu": [
55
{"label": "About ARC", "command": "application:about"},
6-
{"label": "Version", "enabled": false},
6+
{"label": "VERSION", "enabled": false},
77
{"label": "Restart and Install Update", "command": "application:install-update", "visible": false},
88
{"label": "Check for Update", "command": "application:check-for-update", "visible": false},
99
{"label": "Checking for Update", "enabled": false, "visible": false},

app/menus/win.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"label": "Help",
4646
"role": "help",
4747
"submenu": [
48-
{"label": "Version", "enabled": false},
48+
{"label": "VERSION", "enabled": false},
4949
{"label": "Restart and Install Update", "command": "application:install-update", "visible": false},
5050
{"label": "Check for Update", "command": "application:check-for-update", "visible": false},
5151
{"label": "Checking for Update", "enabled": false, "visible": false},

app/scripts/main-menu.js

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class ArcMainMenu extends EventEmitter {
1818
this._getTemplate()
1919
.then(template => this._createFromTemplate(template))
2020
.then(() => Menu.setApplicationMenu(this.topMenu))
21-
.then(() => this.updateVersion())
2221
.catch(cause => {
2322
let message = 'Menu template file was not found.';
2423
console.error(message);
@@ -99,27 +98,6 @@ class ArcMainMenu extends EventEmitter {
9998
}
10099
}
101100

102-
updateVersion() {
103-
var name = this._platformToName(process.platform);
104-
var version = app.getVersion();
105-
this['_' + name + 'UpdateVersion'](version);
106-
}
107-
108-
_darwinUpdateVersion(version) {
109-
var item = this.topMenu.items[0].submenu.items[0];
110-
item.label = 'Version: ' + version;
111-
}
112-
113-
_winUpdateVersion(version) {
114-
var item = this.topMenu.items[3].submenu[0];
115-
item.label = 'Version: ' + version;
116-
}
117-
118-
_linuxUpdateVersion(version) {
119-
var item = this.topMenu.items[3].submenu[0];
120-
item.label = 'Version: ' + version;
121-
}
122-
123101
_itemAction(command, menuItem, browserWindow) {
124102
this.emit('menu-action', command, browserWindow);
125103
}
@@ -144,6 +122,9 @@ class ArcMainMenu extends EventEmitter {
144122
if (options.submenu) {
145123
options.submenu = this._createSubMenu(options.submenu);
146124
}
125+
if (options.label === 'VERSION') {
126+
options.label = 'Version: ' + app.getVersion();
127+
}
147128
return new MenuItem(options);
148129
}
149130

0 commit comments

Comments
 (0)