Skip to content

Media upload bridge method refactor #511

@SergioEstevao

Description

@SergioEstevao

At the moment we have the following bridge methods for media:

export function onMediaLibraryPressed( callback )
export function onUploadMediaPressed( callback )
export function onCapturePhotoPressed( callback )
export function onImageQueryReattach()

They are all related to media, the first three are used to trigger a media picker. So I'm proposing to rename them to

export function onMediaLibraryPressed( callback )
export function onMediaUploadPressed( callback )
export function onMediaCapturePressed( callback )

If you notice the signature they look very similar and only the source of media changes so we can go a step further and refactor them to a single method

export function onMediaPressed( source, callback )

where source could be one of the following values: SITE_MEDIA_LIBRARY, DEVICE_MEDIA_LIBRARY, DEVICE_CAMERA.

the last method is related to resync of media uploads when going back to an ongoing post so we could rename to:

export function mediaUploadResync()

What do you think? any problems with these names?

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions