Skip to content

Commit

Permalink
remove duplcated code even more
Browse files Browse the repository at this point in the history
  • Loading branch information
tessus committed Mar 16, 2019
1 parent cf448b5 commit 47579da
Showing 1 changed file with 17 additions and 37 deletions.
54 changes: 17 additions & 37 deletions ElectronClient/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ class Application extends BaseApplication {
const importItems = [];
const exportItems = [];
const preferencesItems = [];
const toolsItemsFirst = [];
const ioService = new InteropService();
const ioModules = ioService.modules();
for (let i = 0; i < ioModules.length; i++) {
Expand Down Expand Up @@ -413,6 +414,21 @@ class Application extends BaseApplication {
}
});

toolsItemsFirst.push({
label: _('Synchronisation status'),
click: () => {
this.dispatch({
type: 'NAV_GO',
routeName: 'Status',
});
}
}, {
type: 'separator',
screens: ['Main'],
});

const toolsItems = toolsItemsFirst.concat(preferencesItems);

function _checkForUpdates(ctx) {
bridge().checkForUpdates(false, bridge().window(), ctx.checkForUpdateLoggerPath(), { includePreReleases: Setting.value('autoUpdate.includePreReleases') });
}
Expand Down Expand Up @@ -701,43 +717,7 @@ class Application extends BaseApplication {
}, {
label: _('&Tools'),
visible: shim.isMac() ? false : true,
submenu: [{
label: _('Synchronisation status'),
click: () => {
this.dispatch({
type: 'NAV_GO',
routeName: 'Status',
});
}
}, {
type: 'separator',
screens: ['Main'],
},{
label: _('Web clipper options'),
click: () => {
this.dispatch({
type: 'NAV_GO',
routeName: 'ClipperConfig',
});
}
},{
label: _('Encryption options'),
click: () => {
this.dispatch({
type: 'NAV_GO',
routeName: 'EncryptionConfig',
});
}
},{
label: _('General Options'),
accelerator: 'CommandOrControl+,',
click: () => {
this.dispatch({
type: 'NAV_GO',
routeName: 'Config',
});
}
}],
submenu: toolsItems
}, {
label: _('&Help'),
submenu: [{
Expand Down

0 comments on commit 47579da

Please sign in to comment.