From 90b84dce352fabe064e2716f0ddf78bc174b32b1 Mon Sep 17 00:00:00 2001 From: infinite-persistence <64950861+infinite-persistence@users.noreply.github.com> Date: Tue, 10 Oct 2023 02:51:04 +0800 Subject: [PATCH] Sidebar: undo filtering attempt on deleted channels (revert.19f22b98) (#2990) This restores the original behavior of the sidebar (starting off with "first 10 subs", and later with "last 10 active subs"). I think the filtering method failed because of canonical vs. permanent uri reference -- should have tried both or use claim ID. Anyway, reverting for now. --- ui/component/sideNavigation/index.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/ui/component/sideNavigation/index.js b/ui/component/sideNavigation/index.js index 232697705a..c283482d7f 100644 --- a/ui/component/sideNavigation/index.js +++ b/ui/component/sideNavigation/index.js @@ -18,7 +18,7 @@ import { selectUserVerifiedEmail, selectUser } from 'redux/selectors/user'; import { selectClientSettings, selectHomepageData } from 'redux/selectors/settings'; import { doOpenModal, doSignOut } from 'redux/actions/app'; import { selectUnseenNotificationCount } from 'redux/selectors/notifications'; -import { selectClaimsByUri, selectPurchaseUriSuccess, selectResolvingUris } from 'redux/selectors/claims'; +import { selectClaimsByUri, selectPurchaseUriSuccess } from 'redux/selectors/claims'; import { selectUserHasValidOdyseeMembership } from 'redux/selectors/memberships'; import { GetLinksData } from 'util/buildHomepage'; @@ -60,8 +60,6 @@ const selectSidebarCategories = createSelector( function doGetDisplayedSubs(filter) { return async (dispatch, getState) => { - await waitIfResolving(1000, 5, getState); - const state = getState(); const claimsByUri = selectClaimsByUri(state); const subs = selectSubscriptions(state); @@ -81,7 +79,6 @@ function doGetDisplayedSubs(filter) { }); } else { filteredSubs = lastActiveSubs?.length > 0 ? lastActiveSubs : subs.slice(0, SIDEBAR_SUBS_DISPLAYED); - filteredSubs = filteredSubs.filter((sub) => claimsByUri[sub?.uri]); } } @@ -89,14 +86,6 @@ function doGetDisplayedSubs(filter) { }; } -async function waitIfResolving(waitMs, maxAttempts, getState) { - let isResolvingUris = selectResolvingUris(getState()).length > 0; - for (let waitCount = 0; isResolvingUris && waitCount < maxAttempts; ++waitCount) { - await new Promise((resolve) => setTimeout(resolve, waitMs)); - isResolvingUris = selectResolvingUris(getState()).length > 0; - } -} - // **************************************************************************** // SideNavigation // ****************************************************************************