diff --git a/js/lbry.js b/js/lbry.js index d70f53089..b730d4cee 100644 --- a/js/lbry.js +++ b/js/lbry.js @@ -18,7 +18,7 @@ var lbry = { debug: false, useCustomLighthouseServers: false, customLighthouseServers: [], - menu: 'normal', + showDeveloperMenubar: false, } }; @@ -560,15 +560,12 @@ lbry.fileInfoUnsubscribe = function(name, subscribeId) { } lbry.showMenuIfNeeded = function() { - const showingMenu = sessionStorage.getItem('menuShown'); - const chosenMenu = lbry.getClientSetting('menu'); - if (!showingMenu || showingMenu != chosenMenu) { - if (chosenMenu == 'normal') { - menu.showNormalMenubar(); - } else { - menu.showDeveloperMenubar(); - } + const showingMenu = sessionStorage.getItem('menuShown') || null; + const chosenMenu = lbry.getClientSetting('showDeveloperMenu') ? 'developer' : 'normal'; + if (chosenMenu != showingMenu) { + menu.showMenubar(chosenMenu == 'developer'); } + sessionStorage.setItem('menuShown', chosenMenu); }; export default lbry; diff --git a/js/page/developer.js b/js/page/developer.js index afe837db0..88a45542d 100644 --- a/js/page/developer.js +++ b/js/page/developer.js @@ -5,13 +5,13 @@ import FormField from '../component/form.js'; const DeveloperPage = React.createClass({ getInitialState: function() { return { - showDeveloperMenu: lbry.getClientSetting('menu') == 'developer', + showDeveloperMenu: lbry.getClientSetting('showDeveloperMenu'), useCustomLighthouseServers: lbry.getClientSetting('useCustomLighthouseServers'), customLighthouseServers: lbry.getClientSetting('customLighthouseServers').join('\n'), }; }, handleShowDeveloperMenuChange: function(event) { - lbry.setClientSetting('menu', event.target.checked ? 'developer' : 'normal'); + lbry.setClientSetting('showDeveloperMenu', event.target.checked); lbry.showMenuIfNeeded(); this.setState({ showDeveloperMenu: event.target.checked,