diff --git a/ui/component/sideNavigation/view.jsx b/ui/component/sideNavigation/view.jsx index 3f60d76ff..d3e75f7e5 100644 --- a/ui/component/sideNavigation/view.jsx +++ b/ui/component/sideNavigation/view.jsx @@ -121,7 +121,7 @@ type Props = { activeChannelStakedLevel: number, wildWestDisabled: boolean, doClearClaimSearch: () => void, - doFetchLastActiveSubs: (count?: number) => void, + doFetchLastActiveSubs: (force?: boolean, count?: number) => void, }; function SideNavigation(props: Props) { @@ -313,7 +313,8 @@ function SideNavigation(props: Props) { const filter = subscriptionFilter.toLowerCase(); displayedSubscriptions = subscriptions.filter((sub) => sub.channelName.toLowerCase().includes(filter)); } else { - displayedSubscriptions = lastActiveSubs || subscriptions.slice(0, SIDEBAR_SUBS_DISPLAYED); + displayedSubscriptions = + lastActiveSubs && lastActiveSubs.length > 0 ? lastActiveSubs : subscriptions.slice(0, SIDEBAR_SUBS_DISPLAYED); } return ( diff --git a/ui/page/channelsFollowingManage/index.js b/ui/page/channelsFollowingManage/index.js index fd7760c60..3534c6487 100644 --- a/ui/page/channelsFollowingManage/index.js +++ b/ui/page/channelsFollowingManage/index.js @@ -1,5 +1,6 @@ import { connect } from 'react-redux'; import { doResolveUris } from 'redux/actions/claims'; +import { doFetchLastActiveSubs } from 'redux/actions/subscriptions'; import { selectLastActiveSubscriptions, selectSubscriptionUris } from 'redux/selectors/subscriptions'; import ChannelsFollowingManage from './view'; @@ -10,6 +11,7 @@ const select = (state) => ({ const perform = { doResolveUris, + doFetchLastActiveSubs, }; export default connect(select, perform)(ChannelsFollowingManage); diff --git a/ui/page/channelsFollowingManage/view.jsx b/ui/page/channelsFollowingManage/view.jsx index 735133756..8273df37b 100644 --- a/ui/page/channelsFollowingManage/view.jsx +++ b/ui/page/channelsFollowingManage/view.jsx @@ -29,10 +29,11 @@ type Props = { subscribedChannelUris: Array, lastActiveSubs: ?Array, doResolveUris: (uris: Array, returnCachedClaims: boolean, resolveReposts: boolean) => void, + doFetchLastActiveSubs: (force?: boolean, count?: number) => void, }; export default function ChannelsFollowingManage(props: Props) { - const { subscribedChannelUris, lastActiveSubs, doResolveUris } = props; + const { subscribedChannelUris, lastActiveSubs, doResolveUris, doFetchLastActiveSubs } = props; // The locked-on-mount full set of subscribed uris. const [uris, setUris] = React.useState([]); @@ -82,6 +83,10 @@ export default function ChannelsFollowingManage(props: Props) { // eslint-disable-next-line react-hooks/exhaustive-deps, (only need to respond to 'filterQuery') }, [filterQuery]); + React.useEffect(() => { + doFetchLastActiveSubs(true); + }, []); + return (