-
Notifications
You must be signed in to change notification settings - Fork 57
Media upload bridge method refactor #511
Copy link
Copy link
Closed
Labels
[OS] Android[OS] iOS[Type] EnhancementImproves a current area of the editorImproves a current area of the editor
Milestone
Description
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?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[OS] Android[OS] iOS[Type] EnhancementImproves a current area of the editorImproves a current area of the editor