Skip to content

Commit

Permalink
fix(lib/asset): use CID from file data
Browse files Browse the repository at this point in the history
  • Loading branch information
bludnic committed Sep 17, 2024
1 parent d16e134 commit 1eb6d3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/adamant-api/asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ export function reactionAsset(reactToId, reactMessage) {
*/
export function attachmentAsset(files, nonces, ids, comment) {
return {
files: files.map(({ file, width, height }, index) => {
files: files.map(({ file, width, height, cid }, index) => {
const [name, extension] = file.name.split('.')
const resolution = width && height ? [width, height] : undefined
const [nonce, previewNonce] = nonces?.[index] || []
const [id, previewId] = ids?.[index] || []
const [id, previewId] = cid ? [cid, cid] : ids?.[index] || [] // @todo cid preview

return {
mimeType: file.type,
Expand Down

0 comments on commit 1eb6d3c

Please sign in to comment.