From a0917908bb674907755b88db0f4923278c9d18c4 Mon Sep 17 00:00:00 2001
From: jessopb <36554050+jessopb@users.noreply.github.com>
Date: Wed, 15 Dec 2021 15:58:47 -0500
Subject: [PATCH] add feature to enable experimental upgrades (#7353)
---
static/app-strings.json | 1 +
.../settingEnablePrereleases/index.js | 17 +++++++++
.../settingEnablePrereleases/view.jsx | 25 +++++++++++++
ui/component/settingSystem/view.jsx | 35 ++++---------------
ui/constants/settings.js | 1 +
ui/index.jsx | 12 +++++++
ui/redux/reducers/settings.js | 1 +
7 files changed, 64 insertions(+), 28 deletions(-)
create mode 100644 ui/component/settingEnablePrereleases/index.js
create mode 100644 ui/component/settingEnablePrereleases/view.jsx
diff --git a/static/app-strings.json b/static/app-strings.json
index 2519ea806..daa35ab0a 100644
--- a/static/app-strings.json
+++ b/static/app-strings.json
@@ -2225,5 +2225,6 @@
"Buy LBC": "Buy LBC",
"This is information like error logging, performance tracking, and usage statistics. It includes your IP address and basic system details, but no other identifying information (unless you connect to a cloud service)": "This is information like error logging, performance tracking, and usage statistics. It includes your IP address and basic system details, but no other identifying information (unless you connect to a cloud service)",
"Use official LBRY wallet servers": "Use official LBRY wallet servers",
+ "Enable Prerelease Updates": "Enable Prerelease Updates",
"--end--": "--end--"
}
diff --git a/ui/component/settingEnablePrereleases/index.js b/ui/component/settingEnablePrereleases/index.js
new file mode 100644
index 000000000..0db6ad3b9
--- /dev/null
+++ b/ui/component/settingEnablePrereleases/index.js
@@ -0,0 +1,17 @@
+import SettingEnablePrereleases from './view';
+import * as SETTINGS from 'constants/settings';
+import { connect } from 'react-redux';
+import { makeSelectClientSetting } from 'redux/selectors/settings';
+import { doSetClientSetting } from 'redux/actions/settings';
+
+const select = (state) => {
+ return {
+ enablePrereleases: makeSelectClientSetting(SETTINGS.ENABLE_PRERELEASE_UPDATES)(state),
+ };
+};
+
+const perform = (dispatch) => ({
+ setClientSetting: (value) => dispatch(doSetClientSetting(SETTINGS.ENABLE_PRERELEASE_UPDATES, value)),
+});
+
+export default connect(select, perform)(SettingEnablePrereleases);
diff --git a/ui/component/settingEnablePrereleases/view.jsx b/ui/component/settingEnablePrereleases/view.jsx
new file mode 100644
index 000000000..7866b6bbc
--- /dev/null
+++ b/ui/component/settingEnablePrereleases/view.jsx
@@ -0,0 +1,25 @@
+// @flow
+import React from 'react';
+import { FormField } from 'component/common/form';
+
+type Props = {
+ setClientSetting: (boolean) => void,
+ enablePrereleases: boolean,
+};
+function SettingEnablePrereleases(props: Props) {
+ const { setClientSetting, enablePrereleases } = props;
+ return (
+