kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Update "hasIntegerMediaIds" in status
rodzic
3e9a53b1d4
commit
26aca429d3
|
@ -1,3 +1,4 @@
|
||||||
|
import { Attachment } from 'soapbox/types/entities.ts';
|
||||||
import { isIntegerId } from 'soapbox/utils/numbers.tsx';
|
import { isIntegerId } from 'soapbox/utils/numbers.tsx';
|
||||||
|
|
||||||
import type { IntlShape } from 'react-intl';
|
import type { IntlShape } from 'react-intl';
|
||||||
|
@ -40,8 +41,8 @@ export const shouldHaveCard = (status: Pick<Status, 'content'>): boolean => {
|
||||||
|
|
||||||
/** Whether the media IDs on this status have integer IDs (opposed to FlakeIds). */
|
/** Whether the media IDs on this status have integer IDs (opposed to FlakeIds). */
|
||||||
// https://gitlab.com/soapbox-pub/soapbox/-/merge_requests/1087
|
// https://gitlab.com/soapbox-pub/soapbox/-/merge_requests/1087
|
||||||
export const hasIntegerMediaIds = (status: Pick<Status, 'media_attachments'>): boolean => {
|
export const hasIntegerMediaIds = (media_attachments: Attachment[]): boolean => {
|
||||||
return status.media_attachments.some(({ id }) => isIntegerId(id));
|
return media_attachments.some(({ id }) => isIntegerId(id));
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Sanitize status text for use with screen readers. */
|
/** Sanitize status text for use with screen readers. */
|
||||||
|
|
Ładowanie…
Reference in New Issue