remove "showDeveloperMenu" as a setting

This commit is contained in:
Jeremy Kauffman 2017-09-22 19:10:38 -04:00
parent 4a23d13438
commit 5c8db79b69
3 changed files with 1 additions and 47 deletions

View file

@ -37,7 +37,6 @@ let lbry = {
debug: false, debug: false,
useCustomLighthouseServers: false, useCustomLighthouseServers: false,
customLighthouseServers: [], customLighthouseServers: [],
showDeveloperMenu: false,
language: "en", language: "en",
theme: "light", theme: "light",
themes: [], themes: [],
@ -230,9 +229,6 @@ lbry.publishDeprecated = function(
lbry.getClientSetting = function(setting) { lbry.getClientSetting = function(setting) {
var localStorageVal = localStorage.getItem("setting_" + setting); var localStorageVal = localStorage.getItem("setting_" + setting);
if (setting == "showDeveloperMenu") {
return true;
}
return localStorageVal === null return localStorageVal === null
? lbry.defaultClientSettings[setting] ? lbry.defaultClientSettings[setting]
: JSON.parse(localStorageVal); : JSON.parse(localStorageVal);
@ -242,13 +238,6 @@ lbry.setClientSetting = function(setting, value) {
return localStorage.setItem("setting_" + setting, JSON.stringify(value)); return localStorage.setItem("setting_" + setting, JSON.stringify(value));
}; };
lbry.formatName = function(name) {
// Converts LBRY name to standard format (all lower case, no special characters, spaces replaced by dashes)
name = name.replace("/s+/g", "-");
name = name.toLowerCase().replace(lbryuri.REGEXP_INVALID_URI, "");
return name;
};
lbry.imagePath = function(file) { lbry.imagePath = function(file) {
return "img/" + file; return "img/" + file;
}; };
@ -279,17 +268,6 @@ lbry.getMediaType = function(contentType, fileName) {
} }
}; };
lbry.showMenuIfNeeded = function() {
const showingMenu = sessionStorage.getItem("menuShown") || null;
const chosenMenu = lbry.getClientSetting("showDeveloperMenu")
? "developer"
: "normal";
if (chosenMenu != showingMenu) {
menu.showMenubar(chosenMenu == "developer");
}
sessionStorage.setItem("menuShown", chosenMenu);
};
lbry.getAppVersionInfo = function() { lbry.getAppVersionInfo = function() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
ipcRenderer.once("version-info-received", (event, versionInfo) => { ipcRenderer.once("version-info-received", (event, versionInfo) => {

View file

@ -16,14 +16,12 @@ const { remote, ipcRenderer, shell } = require("electron");
const contextMenu = remote.require("./menu/context-menu"); const contextMenu = remote.require("./menu/context-menu");
const app = require("./app"); const app = require("./app");
lbry.showMenuIfNeeded();
window.addEventListener("contextmenu", event => { window.addEventListener("contextmenu", event => {
contextMenu.showContextMenu( contextMenu.showContextMenu(
remote.getCurrentWindow(), remote.getCurrentWindow(),
event.x, event.x,
event.y, event.y,
lbry.getClientSetting("showDeveloperMenu") env === "development"
); );
event.preventDefault(); event.preventDefault();
}); });

View file

@ -11,7 +11,6 @@ class DeveloperPage extends React.PureComponent {
super(props); super(props);
this.state = { this.state = {
showDeveloperMenu: lbry.getClientSetting("showDeveloperMenu"),
useCustomLighthouseServers: lbry.getClientSetting( useCustomLighthouseServers: lbry.getClientSetting(
"useCustomLighthouseServers" "useCustomLighthouseServers"
), ),
@ -22,14 +21,6 @@ class DeveloperPage extends React.PureComponent {
}; };
} }
handleShowDeveloperMenuChange(event) {
lbry.setClientSetting("showDeveloperMenu", event.target.checked);
lbry.showMenuIfNeeded();
this.setState({
showDeveloperMenu: event.target.checked,
});
}
handleUseCustomLighthouseServersChange(event) { handleUseCustomLighthouseServersChange(event) {
lbry.setClientSetting("useCustomLighthouseServers", event.target.checked); lbry.setClientSetting("useCustomLighthouseServers", event.target.checked);
this.setState({ this.setState({
@ -71,19 +62,6 @@ class DeveloperPage extends React.PureComponent {
<main> <main>
<section className="card"> <section className="card">
<h3>{__("Developer Settings")}</h3> <h3>{__("Developer Settings")}</h3>
<div className="form-row">
<label>
<FormField
type="checkbox"
onChange={event => {
this.handleShowDeveloperMenuChange();
}}
checked={this.state.showDeveloperMenu}
/>
{" "}
{__("Show developer menu")}
</label>
</div>
<div className="form-row"> <div className="form-row">
<label> <label>
<FormField <FormField