Add endorsed accounts to profiles in web UI (#34568)
This commit is contained in:
parent
b81c28e7dc
commit
79013c730d
21 changed files with 157 additions and 113 deletions
|
|
@ -5,9 +5,7 @@ import {
|
|||
fetchDirectory
|
||||
} from 'mastodon/actions/directory';
|
||||
import {
|
||||
FEATURED_TAGS_FETCH_REQUEST,
|
||||
FEATURED_TAGS_FETCH_SUCCESS,
|
||||
FEATURED_TAGS_FETCH_FAIL,
|
||||
fetchFeaturedTags
|
||||
} from 'mastodon/actions/featured_tags';
|
||||
|
||||
import {
|
||||
|
|
@ -31,6 +29,7 @@ import {
|
|||
FOLLOW_REQUESTS_EXPAND_FAIL,
|
||||
authorizeFollowRequestSuccess,
|
||||
rejectFollowRequestSuccess,
|
||||
fetchEndorsedAccounts,
|
||||
} from '../actions/accounts';
|
||||
import {
|
||||
BLOCKS_FETCH_REQUEST,
|
||||
|
|
@ -191,21 +190,27 @@ export default function userLists(state = initialState, action) {
|
|||
case MUTES_FETCH_FAIL:
|
||||
case MUTES_EXPAND_FAIL:
|
||||
return state.setIn(['mutes', 'isLoading'], false);
|
||||
case FEATURED_TAGS_FETCH_SUCCESS:
|
||||
return normalizeFeaturedTags(state, ['featured_tags', action.id], action.tags, action.id);
|
||||
case FEATURED_TAGS_FETCH_REQUEST:
|
||||
return state.setIn(['featured_tags', action.id, 'isLoading'], true);
|
||||
case FEATURED_TAGS_FETCH_FAIL:
|
||||
return state.setIn(['featured_tags', action.id, 'isLoading'], false);
|
||||
default:
|
||||
if(fetchDirectory.fulfilled.match(action))
|
||||
if (fetchEndorsedAccounts.fulfilled.match(action))
|
||||
return normalizeList(state, ['featured_accounts', action.meta.arg.accountId], action.payload, undefined);
|
||||
else if (fetchEndorsedAccounts.pending.match(action))
|
||||
return state.setIn(['featured_accounts', action.meta.arg.accountId, 'isLoading'], true);
|
||||
else if (fetchEndorsedAccounts.rejected.match(action))
|
||||
return state.setIn(['featured_accounts', action.meta.arg.accountId, 'isLoading'], false);
|
||||
else if (fetchFeaturedTags.fulfilled.match(action))
|
||||
return normalizeFeaturedTags(state, ['featured_tags', action.meta.arg.accountId], action.payload, action.meta.arg.accountId);
|
||||
else if (fetchFeaturedTags.pending.match(action))
|
||||
return state.setIn(['featured_tags', action.meta.arg.accountId, 'isLoading'], true);
|
||||
else if (fetchFeaturedTags.rejected.match(action))
|
||||
return state.setIn(['featured_tags', action.meta.arg.accountId, 'isLoading'], false);
|
||||
else if (fetchDirectory.fulfilled.match(action))
|
||||
return normalizeList(state, ['directory'], action.payload.accounts, undefined);
|
||||
else if( expandDirectory.fulfilled.match(action))
|
||||
else if (expandDirectory.fulfilled.match(action))
|
||||
return appendToList(state, ['directory'], action.payload.accounts, undefined);
|
||||
else if(fetchDirectory.pending.match(action) ||
|
||||
else if (fetchDirectory.pending.match(action) ||
|
||||
expandDirectory.pending.match(action))
|
||||
return state.setIn(['directory', 'isLoading'], true);
|
||||
else if(fetchDirectory.rejected.match(action) ||
|
||||
else if (fetchDirectory.rejected.match(action) ||
|
||||
expandDirectory.rejected.match(action))
|
||||
return state.setIn(['directory', 'isLoading'], false);
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue