Skip to content

Commit

Permalink
fix: EXIF data on Image asset not included when uploading multiple im…
Browse files Browse the repository at this point in the history
…ages to array type, or via drag-and-drop (#6708)

* fix: exif data on Image asset not included when uploading multiple images to array type, or via drag-and-drop

* Update packages/sanity/src/core/form/members/object/fields/ArrayOfObjectsField.tsx

Co-authored-by: Binoy Patel <me@binoy.io>

* chore: revert testing

---------

Co-authored-by: Binoy Patel <me@binoy.io>
  • Loading branch information
xuzuodong and binoy14 committed May 22, 2024
1 parent fe807a8 commit 222418a
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {type Path, type SchemaType} from '@sanity/types'
import {useToast} from '@sanity/ui'
import {get} from 'lodash'
import {type FocusEvent, useCallback, useEffect, useMemo, useRef} from 'react'
import {type Subscription} from 'rxjs'
import {map, tap} from 'rxjs/operators'
Expand Down Expand Up @@ -335,7 +336,12 @@ export function ArrayOfObjectsField(props: {
open: false,
})

const events$ = uploader.upload(client, file, schemaType).pipe(
const options = {
metadata: get(schemaType, 'options.metadata'),
storeOriginalFilename: get(schemaType, 'options.storeOriginalFilename'),
}

const events$ = uploader.upload(client, file, schemaType, options).pipe(
map((uploadProgressEvent: UploadProgressEvent) =>
PatchEvent.from(uploadProgressEvent.patches || []).prefixAll({_key: key}),
),
Expand Down

0 comments on commit 222418a

Please sign in to comment.