Merge remote-tracking branch 'parent/main' into upstream-20240806
This commit is contained in:
commit
8e5fe5ccb9
166 changed files with 2268 additions and 1390 deletions
|
@ -14,7 +14,7 @@ import type { ApiReportJSON } from 'mastodon/api_types/reports';
|
|||
export const NOTIFICATIONS_GROUP_MAX_AVATARS = 8;
|
||||
|
||||
interface BaseNotificationGroup
|
||||
extends Omit<BaseNotificationGroupJSON, 'sample_accounts'> {
|
||||
extends Omit<BaseNotificationGroupJSON, 'sample_account_ids'> {
|
||||
sampleAccountIds: string[];
|
||||
}
|
||||
|
||||
|
@ -122,8 +122,7 @@ function createAccountRelationshipSeveranceEventFromJSON(
|
|||
export function createNotificationGroupFromJSON(
|
||||
groupJson: ApiNotificationGroupJSON,
|
||||
): NotificationGroup {
|
||||
const { sample_accounts, ...group } = groupJson;
|
||||
const sampleAccountIds = sample_accounts.map((account) => account.id);
|
||||
const { sample_account_ids: sampleAccountIds, ...group } = groupJson;
|
||||
|
||||
switch (group.type) {
|
||||
case 'favourite':
|
||||
|
@ -134,9 +133,9 @@ export function createNotificationGroupFromJSON(
|
|||
case 'status_reference':
|
||||
case 'poll':
|
||||
case 'update': {
|
||||
const { status, ...groupWithoutStatus } = group;
|
||||
const { status_id: statusId, ...groupWithoutStatus } = group;
|
||||
return {
|
||||
statusId: status.id,
|
||||
statusId,
|
||||
sampleAccountIds,
|
||||
...groupWithoutStatus,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue