wordpress-mobile / WordPress-Editor-iOS

⛔️ [DEPRECATED] A reusable iOS rich text editor component.
GNU General Public License v2.0
1.06k stars 210 forks source link

Fix media removal cancel upload #800

Closed SergioEstevao closed 8 years ago

SergioEstevao commented 8 years ago

Fixes #627

How to test:

Insert a media object on the post (video or image), check if on removal of the media event while the upload is happening a console message say "Media Removed: XXX"

Needs Review: @astralbodies

astralbodies commented 8 years ago

Reviewing now @SergioEstevao :smile:

astralbodies commented 8 years ago

It looks like -editorViewController:mediaRemoved: is only being called when I have a post with just an image and I either delete it or click on it to cancel. If I put an image between two paragraphs of text this method is not called.

SergioEstevao commented 8 years ago

@astralbodies ready for another round of review. I converted the NSLog to DDLogInfo so remember to switch to the correct log level on the WPEditorDemoLoggingConfiguration.m in order to see the remove message.

astralbodies commented 8 years ago

Looks like deleting the image calls the delegate - awesome! It appears that tapping the image and selecting cancel upload does not call the delegate now ever.

SergioEstevao commented 8 years ago

@astralbodies: This is expected because when tapping and selecting to cancel then code path goes the other way around, the Native code sends a message to the web view to remove the image, so no callback is needed to notify that the image was removed.

astralbodies commented 8 years ago

Got it - then we're good :shipit:

astralbodies commented 8 years ago

As long as @sendhil is okay with putting this in 6.1 :smile:

SergioEstevao commented 8 years ago

This is a bad bug to have in editor so I should we should add it to 6.1.

SergioEstevao commented 8 years ago

I'm going to merge this on the editor, then we can make the decision on the main repo if we want this fix in.