-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add discrete onMediaUploadPaused handler to media uploads when offline #19884
Changes from all commits
b22021a
d8a7bff
8d46802
8ed6850
ad1ca04
594f989
00df84c
b1f7e3b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1487,15 +1487,15 @@ public void onMediaUploadProgress(final String localMediaId, final float progres | |||||||||||||
} | ||||||||||||||
|
||||||||||||||
@Override | ||||||||||||||
public void onMediaUploadFailed(final String localMediaId, String errorType) { | ||||||||||||||
switch (errorType) { | ||||||||||||||
case "CONNECTION_ERROR": | ||||||||||||||
getGutenbergContainerFragment().mediaFileUploadPaused(Integer.valueOf(localMediaId)); | ||||||||||||||
break; | ||||||||||||||
default: | ||||||||||||||
getGutenbergContainerFragment().mediaFileUploadFailed(Integer.valueOf(localMediaId)); | ||||||||||||||
break; | ||||||||||||||
} | ||||||||||||||
public void onMediaUploadFailed(final String localMediaId) { | ||||||||||||||
getGutenbergContainerFragment().mediaFileUploadFailed(Integer.valueOf(localMediaId)); | ||||||||||||||
mFailedMediaIds.add(localMediaId); | ||||||||||||||
mUploadingMediaProgressMax.remove(localMediaId); | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
@Override | ||||||||||||||
public void onMediaUploadPaused(final String localMediaId) { | ||||||||||||||
getGutenbergContainerFragment().mediaFileUploadPaused(Integer.valueOf(localMediaId)); | ||||||||||||||
mFailedMediaIds.add(localMediaId); | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't really wish to add these localMediaIds to Lines 1591 to 1596 in 234db29
Semantically, this should probably be called There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree a refactor is likely beneficial but unnecessary at this time. That said, I do not believe overloading |
||||||||||||||
mUploadingMediaProgressMax.remove(localMediaId); | ||||||||||||||
} | ||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noting that I added the paused media implementation here. Based upon the existing code, it appears that completed media should be considered failed if it possesses a null remote URL.