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:
Rafael 2022-05-09 08:08:20 -03:00 committed by Thomas Zarebczan
parent adc3c06803
commit 0afeaa6223
2 changed files with 1 additions and 14 deletions

View file

@ -6,7 +6,7 @@ import { selectClientSetting, selectHomepageData, selectWildWestDisabled } from
import Router from './view';
import { normalizeURI } from 'util/lbryURI';
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 { selectHasUnclaimedRefereeReward } from 'redux/selectors/rewards';
import { selectUnseenNotificationCount } from 'redux/selectors/notifications';
@ -46,7 +46,6 @@ const select = (state) => {
const perform = {
setHasNavigated: doSetHasNavigated,
setReferrer: doUserSetReferrer,
doSetActiveChannel,
};
export default connect(select, perform)(Router);

View file

@ -142,7 +142,6 @@ type Props = {
unseenCount: number,
hideTitleNotificationCount: boolean,
hasDefaultChannel: boolean,
doSetActiveChannel: (claimId: ?string, override?: boolean) => void,
};
type PrivateRouteProps = Props & {
@ -185,7 +184,6 @@ function AppRouter(props: Props) {
unseenCount,
hideTitleNotificationCount,
hasDefaultChannel,
doSetActiveChannel,
} = props;
const defaultChannelRef = React.useRef(hasDefaultChannel);
@ -285,16 +283,6 @@ function AppRouter(props: Props) {
defaultChannelRef.current = 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
// We have to redirect here because if we redirect on the server, it might get encoded again
// in the browser causing a redirect loop