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

[Gutenberg] - Cancel failed or in progress uploads if the media block is removed #23125

Merged
merged 3 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gutenberg/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
#
# LOCAL_GUTENBERG=../my-gutenberg-fork bundle exec pod install
ref:
tag: v1.118.0
tag: v1.119.0-alpha1
github_org: wordpress-mobile
repo_name: gutenberg-mobile
6 changes: 3 additions & 3 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ DEPENDENCIES:
- Gifu (= 3.3.1)
- Gravatar (= 1.0.1)
- Gridicons (~> 1.2)
- Gutenberg (from `https://cdn.a8c-ci.services/gutenberg-mobile/Gutenberg-v1.118.0.podspec`)
- Gutenberg (from `https://cdn.a8c-ci.services/gutenberg-mobile/Gutenberg-v1.119.0-alpha1.podspec`)
- JTAppleCalendar (~> 8.0.5)
- Kanvas (~> 1.4.4)
- MediaEditor (>= 1.2.2, ~> 1.2)
Expand Down Expand Up @@ -177,7 +177,7 @@ EXTERNAL SOURCES:
:git: https://github.com/wordpress-mobile/FSInteractiveMap.git
:tag: 0.2.0
Gutenberg:
:podspec: https://cdn.a8c-ci.services/gutenberg-mobile/Gutenberg-v1.118.0.podspec
:podspec: https://cdn.a8c-ci.services/gutenberg-mobile/Gutenberg-v1.119.0-alpha1.podspec

CHECKOUT OPTIONS:
FSInteractiveMap:
Expand All @@ -197,7 +197,7 @@ SPEC CHECKSUMS:
Gifu: 416d4e38c4c2fed012f019e0a1d3ffcb58e5b842
Gravatar: 51437de6811c1d8d6f60c52985f2ca00a85cfc8e
Gridicons: 4455b9f366960121430e45997e32112ae49ffe1d
Gutenberg: 3117b6fe578fb7f0bb75377ba96f436ee05c30fe
Gutenberg: 78b42fa9f4456d1f510f338cd0b2b1ff34e897dc
JTAppleCalendar: 16c6501b22cb27520372c28b0a2e0b12c8d0cd73
Kanvas: cc027f8058de881a4ae2b5aa5f05037b6d054d08
MediaEditor: d08314cfcbfac74361071a306b4bc3a39b3356ae
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,8 @@ class GutenbergMediaInserterHelper: NSObject {
switch state {
case .processing:
gutenberg.mediaUploadUpdate(id: mediaUploadID, state: .uploading, progress: 0, url: nil, serverID: nil)
case .thumbnailReady(let url) where ReachabilityUtils.isInternetReachable() && media.remoteStatus == .failed:
gutenberg.mediaUploadUpdate(id: mediaUploadID, state: .failed, progress: 0, url: url, serverID: nil)
case .thumbnailReady(let url) where !ReachabilityUtils.isInternetReachable() && media.remoteStatus == .failed:
// The progress value passed is ignored by the editor, allowing the UI to retain the last known progress before pausing
gutenberg.mediaUploadUpdate(id: mediaUploadID, state: .paused, progress: 0, url: url, serverID: nil)
case .thumbnailReady(let url):
gutenberg.mediaUploadUpdate(id: mediaUploadID, state: .uploading, progress: 0.20, url: url, serverID: nil)
gutenberg.mediaUploadUpdate(id: mediaUploadID, url: url)
break
case .uploading:
break
Expand Down