diff --git a/package.json b/package.json
index 726a36a22..6508317f2 100644
--- a/package.json
+++ b/package.json
@@ -135,7 +135,7 @@
"imagesloaded": "^4.1.4",
"json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git",
- "lbry-redux": "lbryio/lbry-redux#5547f53f487dacf8c89202ad18f7d2123668be85",
+ "lbry-redux": "lbryio/lbry-redux#52dd14bf9a22d06e34fdb4bf2004129041dbb949",
"lbryinc": "lbryio/lbryinc#cff5dd60934c4c6080e135f47ebbece1548c658c",
"lint-staged": "^7.0.2",
"localforage": "^1.7.1",
diff --git a/static/app-strings.json b/static/app-strings.json
index 536af48e8..52578ed12 100644
--- a/static/app-strings.json
+++ b/static/app-strings.json
@@ -1254,9 +1254,12 @@
"Mature content blocked.": "Mature content blocked.",
"Change this in your %content_settings%.": "Change this in your %content_settings%.",
"content settings": "content settings",
+ "Autoplay next in list": "Autoplay next in list",
+ "Autoplay the next media file in the related list.": "Autoplay the next media file in the related list.",
"There was an error with LBRY first publishing.": "There was an error with LBRY first publishing.",
"Automagically upload to your youtube channel.": "Automagically upload to your youtube channel.",
"Your file was published to LBRY, but the YouTube upload failed.": "Your file was published to LBRY, but the YouTube upload failed.",
+ "Your servers were not available. Check your url and port, or switch back to defaults.": "Your servers were not available. Check your url and port, or switch back to defaults.",
"LBRY Status": "LBRY Status",
"Check the status of various LBRY services.": "Check the status of various LBRY services.",
"Check Status": "Check Status",
@@ -1265,5 +1268,6 @@
"View thumbnail": "View thumbnail",
"These changes will appear shortly.": "These changes will appear shortly.",
"Block Channel": "Block Channel",
+ "Manage Notifications": "Manage Notifications",
"--end--": "--end--"
}
diff --git a/ui/component/app/index.js b/ui/component/app/index.js
index af954ce58..98871dbb0 100644
--- a/ui/component/app/index.js
+++ b/ui/component/app/index.js
@@ -1,11 +1,10 @@
-import * as SETTINGS from 'constants/settings';
import { hot } from 'react-hot-loader/root';
import { connect } from 'react-redux';
import { selectGetSyncErrorMessage, selectUploadCount } from 'lbryinc';
import { doFetchAccessToken, doUserSetReferrer } from 'redux/actions/user';
import { selectUser, selectAccessToken, selectUserVerifiedEmail } from 'redux/selectors/user';
import { selectUnclaimedRewards } from 'redux/selectors/rewards';
-import { doFetchChannelListMine } from 'lbry-redux';
+import { doFetchChannelListMine, SETTINGS } from 'lbry-redux';
import { makeSelectClientSetting, selectLoadedLanguages, selectThemePath } from 'redux/selectors/settings';
import { selectIsUpgradeAvailable, selectAutoUpdateDownloaded } from 'redux/selectors/app';
import { doSetLanguage } from 'redux/actions/settings';
diff --git a/ui/component/autoplayCountdown/index.js b/ui/component/autoplayCountdown/index.js
index e7d767071..68fdcf135 100644
--- a/ui/component/autoplayCountdown/index.js
+++ b/ui/component/autoplayCountdown/index.js
@@ -1,6 +1,5 @@
-import * as SETTINGS from 'constants/settings';
import { connect } from 'react-redux';
-import { makeSelectClaimForUri } from 'lbry-redux';
+import { makeSelectClaimForUri, SETTINGS } from 'lbry-redux';
import { withRouter } from 'react-router';
import { makeSelectIsPlayerFloating, makeSelectNextUnplayedRecommended } from 'redux/selectors/content';
import { makeSelectClientSetting } from 'redux/selectors/settings';
diff --git a/ui/component/channelContent/index.js b/ui/component/channelContent/index.js
index e427523ec..29cfaadc5 100644
--- a/ui/component/channelContent/index.js
+++ b/ui/component/channelContent/index.js
@@ -1,4 +1,3 @@
-import * as SETTINGS from 'constants/settings';
import { connect } from 'react-redux';
import { PAGE_SIZE } from 'constants/claim';
import {
@@ -7,6 +6,7 @@ import {
makeSelectClaimIsMine,
makeSelectTotalPagesInChannelSearch,
makeSelectClaimForUri,
+ SETTINGS,
} from 'lbry-redux';
import { selectChannelIsBlocked } from 'redux/selectors/blocked';
import { withRouter } from 'react-router';
diff --git a/ui/component/emailCollection/index.js b/ui/component/emailCollection/index.js
index 1e495c693..c3a28a4e5 100644
--- a/ui/component/emailCollection/index.js
+++ b/ui/component/emailCollection/index.js
@@ -1,9 +1,9 @@
-import * as SETTINGS from 'constants/settings';
import { connect } from 'react-redux';
import { doSetClientSetting } from 'redux/actions/settings';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import { selectEmailToVerify, selectUser } from 'redux/selectors/user';
import FirstRunEmailCollection from './view';
+import { SETTINGS } from 'lbry-redux';
const select = state => ({
emailCollectionAcknowledged: makeSelectClientSetting(SETTINGS.EMAIL_COLLECTION_ACKNOWLEDGED)(state),
diff --git a/ui/component/embedPlayButton/index.js b/ui/component/embedPlayButton/index.js
index e910e7915..9fd9331ac 100644
--- a/ui/component/embedPlayButton/index.js
+++ b/ui/component/embedPlayButton/index.js
@@ -1,6 +1,5 @@
-import * as SETTINGS from 'constants/settings';
import { connect } from 'react-redux';
-import { makeSelectThumbnailForUri, doResolveUri, makeSelectClaimForUri } from 'lbry-redux';
+import { makeSelectThumbnailForUri, doResolveUri, makeSelectClaimForUri, SETTINGS } from 'lbry-redux';
import { doFetchCostInfoForUri, makeSelectCostInfoForUri } from 'lbryinc';
import { doSetFloatingUri, doPlayUri } from 'redux/actions/content';
import { doAnaltyicsPurchaseEvent } from 'redux/actions/app';
diff --git a/ui/component/fileRender/index.js b/ui/component/fileRender/index.js
index 12a970a34..b09fd76d7 100644
--- a/ui/component/fileRender/index.js
+++ b/ui/component/fileRender/index.js
@@ -5,8 +5,8 @@ import {
makeSelectContentTypeForUri,
makeSelectDownloadPathForUri,
makeSelectStreamingUrlForUri,
+ SETTINGS,
} from 'lbry-redux';
-import * as SETTINGS from 'constants/settings';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import { makeSelectFileRenderModeForUri, makeSelectFileExtensionForUri } from 'redux/selectors/content';
import FileRender from './view';
diff --git a/ui/component/fileRenderFloating/index.js b/ui/component/fileRenderFloating/index.js
index e3b1df280..b9aa3bf62 100644
--- a/ui/component/fileRenderFloating/index.js
+++ b/ui/component/fileRenderFloating/index.js
@@ -1,6 +1,5 @@
-import * as SETTINGS from 'constants/settings';
import { connect } from 'react-redux';
-import { makeSelectFileInfoForUri, makeSelectTitleForUri, makeSelectStreamingUrlForUri } from 'lbry-redux';
+import { makeSelectFileInfoForUri, makeSelectTitleForUri, makeSelectStreamingUrlForUri, SETTINGS } from 'lbry-redux';
import {
makeSelectIsPlayerFloating,
selectFloatingUri,
diff --git a/ui/component/fileRenderInitiator/index.js b/ui/component/fileRenderInitiator/index.js
index 6f64fa572..089bdfbce 100644
--- a/ui/component/fileRenderInitiator/index.js
+++ b/ui/component/fileRenderInitiator/index.js
@@ -1,4 +1,3 @@
-import * as SETTINGS from 'constants/settings';
import { connect } from 'react-redux';
import { doPlayUri, doSetPlayingUri } from 'redux/actions/content';
import {
@@ -7,6 +6,7 @@ import {
makeSelectClaimForUri,
makeSelectStreamingUrlForUri,
makeSelectClaimWasPurchased,
+ SETTINGS,
} from 'lbry-redux';
import { makeSelectCostInfoForUri } from 'lbryinc';
import { selectUserVerifiedEmail } from 'redux/selectors/user';
diff --git a/ui/component/header/index.js b/ui/component/header/index.js
index 1ab115301..db551f2ff 100644
--- a/ui/component/header/index.js
+++ b/ui/component/header/index.js
@@ -1,7 +1,6 @@
-import * as SETTINGS from 'constants/settings';
import * as MODALS from 'constants/modal_types';
import { connect } from 'react-redux';
-import { selectBalance, formatCredits } from 'lbry-redux';
+import { selectBalance, formatCredits, SETTINGS } from 'lbry-redux';
import { selectGetSyncErrorMessage } from 'lbryinc';
import { selectUserVerifiedEmail, selectUserEmail, selectEmailToVerify } from 'redux/selectors/user';
import { doClearEmailEntry, doClearPasswordEntry } from 'redux/actions/user';
@@ -9,6 +8,7 @@ import { doSetClientSetting } from 'redux/actions/settings';
import { doSignOut, doOpenModal } from 'redux/actions/app';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import Header from './view';
+import { selectHasNavigated } from 'redux/selectors/app';
const select = state => ({
balance: selectBalance(state),
@@ -21,6 +21,7 @@ const select = state => ({
email: selectUserEmail(state),
syncError: selectGetSyncErrorMessage(state),
emailToVerify: selectEmailToVerify(state),
+ hasNavigated: selectHasNavigated(state),
});
const perform = dispatch => ({
diff --git a/ui/component/header/view.jsx b/ui/component/header/view.jsx
index a2799f303..ddd56826e 100644
--- a/ui/component/header/view.jsx
+++ b/ui/component/header/view.jsx
@@ -1,6 +1,6 @@
// @flow
import * as ICONS from 'constants/icons';
-import * as SETTINGS from 'constants/settings';
+import { SETTINGS } from 'lbry-redux';
import * as PAGES from 'constants/pages';
import React, { Fragment } from 'react';
import { withRouter } from 'react-router';
@@ -31,6 +31,7 @@ type Props = {
length: number,
location: { pathname: string },
push: string => void,
+ replace: string => void,
},
currentTheme: string,
automaticDarkModeEnabled: boolean,
@@ -40,7 +41,9 @@ type Props = {
authenticated: boolean,
authHeader: boolean,
backout: {
- backFunction: () => void,
+ backLabel?: string,
+ backCB?: () => void,
+ backNavDefault?: string,
title: string,
simpleTitle: string, // Just use the same value as `title` if `title` is already short (~< 10 chars), unless you have a better idea for title overlfow on mobile
},
@@ -52,6 +55,7 @@ type Props = {
openSignOutModal: () => void,
clearEmailEntry: () => void,
clearPasswordEntry: () => void,
+ hasNavigated: boolean,
};
const Header = (props: Props) => {
@@ -80,6 +84,8 @@ const Header = (props: Props) => {
const isSignUpPage = history.location.pathname.includes(PAGES.AUTH);
const isSignInPage = history.location.pathname.includes(PAGES.AUTH_SIGNIN);
const isPwdResetPage = history.location.pathname.includes(PAGES.AUTH_PASSWORD_RESET);
+ const hasBackout = Boolean(backout);
+ const { backLabel, backCB, backNavDefault, title: backTitle, simpleTitle: simpleBackTitle } = backout || {};
// Sign out if they click the "x" when they are on the password prompt
const authHeaderAction = syncError ? { onClick: signOut } : { navigate: '/' };
@@ -107,6 +113,32 @@ const Header = (props: Props) => {
},
};
+ React.useEffect(() => {
+ if (hasBackout) {
+ window.addEventListener('popstate', onBackout);
+ return () => window.removeEvenListener('popstate', onBackout);
+ }
+ }, [hasBackout]);
+
+ function onBackout(e) {
+ const { history, hasNavigated } = props;
+ const { goBack, replace } = history;
+
+ window.removeEventListener('popstate', onBackout);
+
+ if (backCB) {
+ backCB();
+ }
+ if (e.type !== 'popstate') {
+ // if not initiated by pop (back button)
+ if (hasNavigated && !backNavDefault) {
+ goBack();
+ } else {
+ replace(backNavDefault || `/`);
+ }
+ }
+ }
+
function handleThemeToggle() {
if (automaticDarkModeEnabled) {
setClientSetting(SETTINGS.AUTOMATIC_DARK_MODE_ENABLED, false);
@@ -149,15 +181,19 @@ const Header = (props: Props) => {
{!authHeader && backout ? (
-
- {backout.title && (
-
{isMobile ? backout.simpleTitle || backout.title : backout.title}
- )}
+
+ {backTitle &&
{isMobile ? simpleBackTitle || backTitle : backTitle}
}