Merge remote-tracking branch 'parent/main' into upstream-20241126

This commit is contained in:
KMY 2024-11-26 12:56:31 +09:00
commit 8a075ba4c6
303 changed files with 7495 additions and 4498 deletions

View file

@ -0,0 +1,15 @@
import { createSelector } from '@reduxjs/toolkit';
import type { Map as ImmutableMap } from 'immutable';
import type { Antenna } from 'mastodon/models/antenna';
import type { RootState } from 'mastodon/store';
export const getOrderedAntennas = createSelector(
[(state: RootState) => state.antennas],
(antennas: ImmutableMap<string, Antenna | null>) =>
antennas
.toList()
.filter((item: Antenna | null) => !!item)
.sort((a: Antenna, b: Antenna) => a.title.localeCompare(b.title))
.toArray(),
);

View file

@ -0,0 +1,17 @@
import { createSelector } from '@reduxjs/toolkit';
import type { Map as ImmutableMap } from 'immutable';
import type { BookmarkCategory } from 'mastodon/models/bookmark_category';
import type { RootState } from 'mastodon/store';
export const getOrderedBookmarkCategories = createSelector(
[(state: RootState) => state.bookmark_categories],
(bookmark_categories: ImmutableMap<string, BookmarkCategory | null>) =>
bookmark_categories
.toList()
.filter((item: BookmarkCategory | null) => !!item)
.sort((a: BookmarkCategory, b: BookmarkCategory) =>
a.title.localeCompare(b.title),
)
.toArray(),
);

View file

@ -0,0 +1,15 @@
import { createSelector } from '@reduxjs/toolkit';
import type { Map as ImmutableMap } from 'immutable';
import type { Circle } from 'mastodon/models/circle';
import type { RootState } from 'mastodon/store';
export const getOrderedCircles = createSelector(
[(state: RootState) => state.circles],
(circles: ImmutableMap<string, Circle | null>) =>
circles
.toList()
.filter((item: Circle | null) => !!item)
.sort((a: Circle, b: Circle) => a.title.localeCompare(b.title))
.toArray(),
);

View file

@ -0,0 +1,15 @@
import { createSelector } from '@reduxjs/toolkit';
import type { Map as ImmutableMap } from 'immutable';
import type { List } from 'mastodon/models/list';
import type { RootState } from 'mastodon/store';
export const getOrderedLists = createSelector(
[(state: RootState) => state.lists],
(lists: ImmutableMap<string, List | null>) =>
lists
.toList()
.filter((item: List | null) => !!item)
.sort((a: List, b: List) => a.title.localeCompare(b.title))
.toArray(),
);