FYP: batch resolve results

This commit is contained in:
infinite-persistence 2022-03-16 10:57:26 +08:00
parent fc3e3ae844
commit e9559efe10
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0

View file

@ -256,12 +256,11 @@ export const doFetchPersonalRecommendations = () => (dispatch: Dispatch, getStat
.then((data) => { .then((data) => {
const { gid, recs } = data; const { gid, recs } = data;
if (gid && recs) { if (gid && recs) {
const uris = processLighthouseResults(recs);
dispatch(doResolveUris(uris));
dispatch({ dispatch({
type: ACTIONS.FYP_FETCH_SUCCESS, type: ACTIONS.FYP_FETCH_SUCCESS,
data: { data: { gid, uris },
gid,
uris: processLighthouseResults(recs),
},
}); });
} else { } else {
dispatch({ type: ACTIONS.FYP_FETCH_FAILED }); dispatch({ type: ACTIONS.FYP_FETCH_FAILED });