Skip to content

Commit

Permalink
fix(attachments): sort for gifs
Browse files Browse the repository at this point in the history
  • Loading branch information
egorprnn committed Oct 9, 2021
1 parent 9a7d380 commit e4f6ea0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/modules/Attachments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ export class Attachments {
const attachmentFields: string[] = [];

const parsedAttachments = attachments
// Fix для гифок (если первым вложением гифка, то следующие фотографии переносятся в другой embed)
.sort((a, b) => (
b.type === DOCUMENT && b.doc.ext === 'gif' ?
-1
:
1
))
.reduce<string[]>((parsedAttachments, {
type, photo, video, link, doc, audio, poll, album, textlive, market
}) => {
Expand Down

0 comments on commit e4f6ea0

Please sign in to comment.