Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media upload bridge method refactor #511

Closed
SergioEstevao opened this issue Jan 28, 2019 · 1 comment
Closed

Media upload bridge method refactor #511

SergioEstevao opened this issue Jan 28, 2019 · 1 comment
Assignees
Labels
[OS] Android [OS] iOS [Type] Enhancement Improves a current area of the editor
Milestone

Comments

@SergioEstevao
Copy link
Contributor

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?

@mzorz
Copy link
Contributor

mzorz commented Jan 30, 2019

Closing via #516 and WordPress/gutenberg#13554

@mzorz mzorz closed this as completed Jan 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[OS] Android [OS] iOS [Type] Enhancement Improves a current area of the editor
Projects
None yet
Development

No branches or pull requests

3 participants