Remove active channel cleanup function
- reverts active channel functionality back to how it was previously, making the default channel simply a sync fallback and removing all complexity and confusion
This commit is contained in:
parent
adc3c06803
commit
0afeaa6223
2 changed files with 1 additions and 14 deletions
|
@ -6,7 +6,7 @@ import { selectClientSetting, selectHomepageData, selectWildWestDisabled } from
|
||||||
import Router from './view';
|
import Router from './view';
|
||||||
import { normalizeURI } from 'util/lbryURI';
|
import { normalizeURI } from 'util/lbryURI';
|
||||||
import { selectTitleForUri } from 'redux/selectors/claims';
|
import { selectTitleForUri } from 'redux/selectors/claims';
|
||||||
import { doSetHasNavigated, doSetActiveChannel } from 'redux/actions/app';
|
import { doSetHasNavigated } from 'redux/actions/app';
|
||||||
import { doUserSetReferrer } from 'redux/actions/user';
|
import { doUserSetReferrer } from 'redux/actions/user';
|
||||||
import { selectHasUnclaimedRefereeReward } from 'redux/selectors/rewards';
|
import { selectHasUnclaimedRefereeReward } from 'redux/selectors/rewards';
|
||||||
import { selectUnseenNotificationCount } from 'redux/selectors/notifications';
|
import { selectUnseenNotificationCount } from 'redux/selectors/notifications';
|
||||||
|
@ -46,7 +46,6 @@ const select = (state) => {
|
||||||
const perform = {
|
const perform = {
|
||||||
setHasNavigated: doSetHasNavigated,
|
setHasNavigated: doSetHasNavigated,
|
||||||
setReferrer: doUserSetReferrer,
|
setReferrer: doUserSetReferrer,
|
||||||
doSetActiveChannel,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default connect(select, perform)(Router);
|
export default connect(select, perform)(Router);
|
||||||
|
|
|
@ -142,7 +142,6 @@ type Props = {
|
||||||
unseenCount: number,
|
unseenCount: number,
|
||||||
hideTitleNotificationCount: boolean,
|
hideTitleNotificationCount: boolean,
|
||||||
hasDefaultChannel: boolean,
|
hasDefaultChannel: boolean,
|
||||||
doSetActiveChannel: (claimId: ?string, override?: boolean) => void,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
type PrivateRouteProps = Props & {
|
type PrivateRouteProps = Props & {
|
||||||
|
@ -185,7 +184,6 @@ function AppRouter(props: Props) {
|
||||||
unseenCount,
|
unseenCount,
|
||||||
hideTitleNotificationCount,
|
hideTitleNotificationCount,
|
||||||
hasDefaultChannel,
|
hasDefaultChannel,
|
||||||
doSetActiveChannel,
|
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const defaultChannelRef = React.useRef(hasDefaultChannel);
|
const defaultChannelRef = React.useRef(hasDefaultChannel);
|
||||||
|
@ -285,16 +283,6 @@ function AppRouter(props: Props) {
|
||||||
defaultChannelRef.current = hasDefaultChannel;
|
defaultChannelRef.current = hasDefaultChannel;
|
||||||
}, [hasDefaultChannel]);
|
}, [hasDefaultChannel]);
|
||||||
|
|
||||||
React.useEffect(() => {
|
|
||||||
return () => {
|
|
||||||
// has a default channel selected, clear the current active channel
|
|
||||||
if (defaultChannelRef.current) {
|
|
||||||
doSetActiveChannel(null, true);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, [pathname]);
|
|
||||||
|
|
||||||
// react-router doesn't decode pathanmes before doing the route matching check
|
// react-router doesn't decode pathanmes before doing the route matching check
|
||||||
// We have to redirect here because if we redirect on the server, it might get encoded again
|
// We have to redirect here because if we redirect on the server, it might get encoded again
|
||||||
// in the browser causing a redirect loop
|
// in the browser causing a redirect loop
|
||||||
|
|
Loading…
Reference in a new issue