TMP: switch fyp batch-resolve to claim_search

There is an intermittent bug with a batched `resolve`, where results are jumbled up. Switch to `claim_search` until that is resolved.
This commit is contained in:
infinite-persistence 2022-03-23 10:42:12 +08:00 committed by Thomas Zarebczan
parent db38cc597f
commit 8fd64b2b41

View file

@ -5,7 +5,7 @@ import { doOpenModal } from 'redux/actions/app';
import { doToast } from 'redux/actions/notifications'; import { doToast } from 'redux/actions/notifications';
import { selectShowMatureContent } from 'redux/selectors/settings'; import { selectShowMatureContent } from 'redux/selectors/settings';
import { selectClaimForUri, selectClaimIdForUri, selectClaimIsNsfwForUri } from 'redux/selectors/claims'; import { selectClaimForUri, selectClaimIdForUri, selectClaimIsNsfwForUri } from 'redux/selectors/claims';
import { doResolveUris } from 'redux/actions/claims'; import { doClaimSearch, doResolveUris } from 'redux/actions/claims';
import { buildURI, isURIValid } from 'util/lbryURI'; import { buildURI, isURIValid } from 'util/lbryURI';
import { batchActions } from 'util/batch-actions'; import { batchActions } from 'util/batch-actions';
import { makeSelectSearchUrisForQuery, selectPersonalRecommendations, selectSearchValue } from 'redux/selectors/search'; import { makeSelectSearchUrisForQuery, selectPersonalRecommendations, selectSearchValue } from 'redux/selectors/search';
@ -263,10 +263,18 @@ export const doFetchPersonalRecommendations = () => (dispatch: Dispatch, getStat
const { gid, recs } = data; const { gid, recs } = data;
if (gid && recs) { if (gid && recs) {
const uris = processLighthouseResults(recs); const uris = processLighthouseResults(recs);
dispatch(doResolveUris(uris)); dispatch(
dispatch({ doClaimSearch({
type: ACTIONS.FYP_FETCH_SUCCESS, claim_ids: recs.map((r) => r.claimId),
data: { gid, uris }, page: 1,
page_size: 50,
no_totals: true,
})
).finally(() => {
dispatch({
type: ACTIONS.FYP_FETCH_SUCCESS,
data: { gid, uris },
});
}); });
} else { } else {
dispatch({ type: ACTIONS.FYP_FETCH_FAILED }); dispatch({ type: ACTIONS.FYP_FETCH_FAILED });