Merge remote-tracking branch 'parent/main' into upstream-20250414
This commit is contained in:
commit
dba5f3b93f
208 changed files with 3210 additions and 2896 deletions
|
@ -6,6 +6,7 @@ import { me, isHideItem } from '../initial_state';
|
|||
import { getFilters } from './filters';
|
||||
|
||||
export { makeGetAccount } from "./accounts";
|
||||
export { getStatusList, getSubStatusList } from "./statuses";
|
||||
|
||||
export const makeGetStatus = () => {
|
||||
return createSelector(
|
||||
|
@ -93,15 +94,3 @@ export const makeGetReport = () => createSelector([
|
|||
(_, base) => base,
|
||||
(state, _, targetAccountId) => state.getIn(['accounts', targetAccountId]),
|
||||
], (base, targetAccount) => base.set('target_account', targetAccount));
|
||||
|
||||
export const getStatusList = createSelector([
|
||||
(state, type) => state.getIn(['status_lists', type, 'items']),
|
||||
], (items) => items.toList());
|
||||
|
||||
export const getBookmarkCategoryStatusList = createSelector([
|
||||
(state, bookmarkCategoryId) => state.getIn(['status_lists', 'bookmark_category_statuses', bookmarkCategoryId, 'items']),
|
||||
], (items) => items ? items.toList() : ImmutableList());
|
||||
|
||||
export const getCircleStatusList = createSelector([
|
||||
(state, circleId) => state.getIn(['status_lists', 'circle_statuses', circleId, `items`]),
|
||||
], (items) => items ? items.toList() : ImmutableList());
|
||||
|
|
33
app/javascript/mastodon/selectors/statuses.ts
Normal file
33
app/javascript/mastodon/selectors/statuses.ts
Normal file
|
@ -0,0 +1,33 @@
|
|||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import type { OrderedSet as ImmutableOrderedSet } from 'immutable';
|
||||
import { List as ImmutableList } from 'immutable';
|
||||
|
||||
import type { RootState } from 'mastodon/store';
|
||||
|
||||
export const getStatusList = createSelector(
|
||||
[
|
||||
(
|
||||
state: RootState,
|
||||
type:
|
||||
| 'favourites'
|
||||
| 'bookmarks'
|
||||
| 'pins'
|
||||
| 'trending'
|
||||
| 'emoji_reactions',
|
||||
) =>
|
||||
state.status_lists.getIn([type, 'items']) as ImmutableOrderedSet<string>,
|
||||
],
|
||||
(items) => items.toList(),
|
||||
);
|
||||
|
||||
export const getSubStatusList = createSelector(
|
||||
[
|
||||
(state: RootState, type: 'bookmark_category' | 'circle', id: string) =>
|
||||
state.status_lists.getIn([
|
||||
`${type}_statuses`,
|
||||
id,
|
||||
'items',
|
||||
]) as ImmutableOrderedSet<string> | null,
|
||||
],
|
||||
(items) => (items ? items.toList() : ImmutableList()),
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue