Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Commit

Permalink
Fix license registration menu item is not shown on Windows & Linux (#196
Browse files Browse the repository at this point in the history
)
  • Loading branch information
quanglam2807 authored Jun 15, 2020
1 parent 63de85b commit ad3b0e9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
18 changes: 13 additions & 5 deletions public/libs/create-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ const createMenu = () => {
label: getLocale('window'),
submenu: [
{ role: 'minimize', label: getLocale('minimize') },
{ role: 'zoom', label: getLocale('zoom') },
{ type: 'separator' },
{ role: 'close', label: getLocale('close') },
],
Expand All @@ -154,9 +153,8 @@ const createMenu = () => {
},
];

const registered = getPreference('registered');
if (process.platform === 'darwin') {
const registered = getPreference('registered');

template.unshift({
label: config.APP_NAME,
submenu: [
Expand All @@ -175,13 +173,13 @@ const createMenu = () => {
},
{
type: 'separator',
visible: process.platform === 'darwin' && !process.mas,
visible: !process.mas,
},
{
label: registered ? getLocale('registered') : getLocale('registration'),
enabled: !registered,
click: registered ? null : () => sendToAllWindows('open-license-registration-dialog'),
visible: process.platform === 'darwin' && !process.mas,
visible: !process.mas,
},
{ type: 'separator' },
{
Expand Down Expand Up @@ -213,6 +211,16 @@ const createMenu = () => {
label: getLocale('about'),
click: () => sendToAllWindows('open-dialog-about'),
},
{
type: 'separator',
visible: !process.windowsStore,
},
{
label: registered ? getLocale('registered') : getLocale('registration'),
enabled: !registered,
click: registered ? null : () => sendToAllWindows('open-license-registration-dialog'),
visible: !process.windowsStore,
},
{
type: 'separator',
},
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5596,9 +5596,9 @@ eslint-utils@^1.4.3:
eslint-visitor-keys "^1.1.0"

eslint-utils@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.0.0.tgz#7be1cc70f27a72a76cd14aa698bcabed6890e1cd"
integrity sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==
version "2.1.0"
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27"
integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==
dependencies:
eslint-visitor-keys "^1.1.0"

Expand Down

0 comments on commit ad3b0e9

Please sign in to comment.