Skip to content

Commit c4c5b52

Browse files
authored
feat: Provide Gutenberg editor network connection status (#22112)
2 parents 4dd6f4e + 9b61a49 commit c4c5b52

File tree

3 files changed

+25
-12
lines changed

3 files changed

+25
-12
lines changed

Gutenberg/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
#
1010
# LOCAL_GUTENBERG=../my-gutenberg-fork bundle exec pod install
1111
ref:
12-
tag: v1.109.2
12+
tag: v1.110.0-alpha2
1313
github_org: wordpress-mobile
1414
repo_name: gutenberg-mobile

Podfile.lock

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ PODS:
4949
- OHHTTPStubs/Swift (9.1.0):
5050
- OHHTTPStubs/Default
5151
- Reachability (3.2)
52-
- Sentry (8.17.0):
53-
- Sentry/Core (= 8.17.0)
54-
- SentryPrivate (= 8.17.0)
55-
- Sentry/Core (8.17.0):
56-
- SentryPrivate (= 8.17.0)
57-
- SentryPrivate (8.17.0)
52+
- Sentry (8.15.2):
53+
- Sentry/Core (= 8.15.2)
54+
- SentryPrivate (= 8.15.2)
55+
- Sentry/Core (8.15.2):
56+
- SentryPrivate (= 8.15.2)
57+
- SentryPrivate (8.15.2)
5858
- Sodium (0.9.1)
5959
- Starscream (3.0.6)
6060
- SVProgressHUD (2.2.5)
@@ -107,7 +107,7 @@ DEPENDENCIES:
107107
- FSInteractiveMap (from `https://github.com/wordpress-mobile/FSInteractiveMap.git`, tag `0.2.0`)
108108
- Gifu (= 3.3.1)
109109
- Gridicons (~> 1.2)
110-
- Gutenberg (from `https://cdn.a8c-ci.services/gutenberg-mobile/Gutenberg-v1.109.2.podspec`)
110+
- Gutenberg (from `https://cdn.a8c-ci.services/gutenberg-mobile/Gutenberg-v1.110.0-alpha2.podspec`)
111111
- JTAppleCalendar (~> 8.0.5)
112112
- Kanvas (~> 1.4.4)
113113
- MediaEditor (>= 1.2.2, ~> 1.2)
@@ -176,7 +176,7 @@ EXTERNAL SOURCES:
176176
:git: https://github.com/wordpress-mobile/FSInteractiveMap.git
177177
:tag: 0.2.0
178178
Gutenberg:
179-
:podspec: https://cdn.a8c-ci.services/gutenberg-mobile/Gutenberg-v1.109.2.podspec
179+
:podspec: https://cdn.a8c-ci.services/gutenberg-mobile/Gutenberg-v1.110.0-alpha2.podspec
180180

181181
CHECKOUT OPTIONS:
182182
FSInteractiveMap:
@@ -195,7 +195,7 @@ SPEC CHECKSUMS:
195195
FSInteractiveMap: a396f610f48b76cb540baa87139d056429abda86
196196
Gifu: 416d4e38c4c2fed012f019e0a1d3ffcb58e5b842
197197
Gridicons: 4455b9f366960121430e45997e32112ae49ffe1d
198-
Gutenberg: c144eb81ca9afbbe60734fd3c5abdd68940e08ec
198+
Gutenberg: fd7f055a7ec5c27c993e176c3c2b2a6548789b8d
199199
JTAppleCalendar: 16c6501b22cb27520372c28b0a2e0b12c8d0cd73
200200
Kanvas: cc027f8058de881a4ae2b5aa5f05037b6d054d08
201201
MediaEditor: d08314cfcbfac74361071a306b4bc3a39b3356ae
@@ -204,8 +204,8 @@ SPEC CHECKSUMS:
204204
OCMock: 43565190abc78977ad44a61c0d20d7f0784d35ab
205205
OHHTTPStubs: 90eac6d8f2c18317baeca36698523dc67c513831
206206
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
207-
Sentry: 08c4200e02bd1dc235c57c904b948e65f8f3ceb4
208-
SentryPrivate: 1986fdf51e44758f7e191ee8fa8bf072e391d461
207+
Sentry: 6f5742b4c47c17c9adcf265f6f328cf4a0ed1923
208+
SentryPrivate: b2f7996f37781080f04a946eb4e377ff63c64195
209209
Sodium: 23d11554ecd556196d313cf6130d406dfe7ac6da
210210
Starscream: ef3ece99d765eeccb67de105bfa143f929026cf5
211211
SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6

WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega
344344
setupGutenbergView()
345345
configureNavigationBar()
346346
refreshInterface()
347+
observeNetworkStatus()
347348

348349
gutenberg.delegate = self
349350
fetchBlockSettings()
@@ -1076,13 +1077,25 @@ extension GutenbergViewController: GutenbergBridgeDelegate {
10761077
self.topmostPresentedViewController.present(navController, animated: true)
10771078
}
10781079

1080+
func gutenbergDidRequestConnectionStatus() -> Bool {
1081+
return ReachabilityUtils.isInternetReachable()
1082+
}
1083+
10791084
func gutenbergDidRequestSendEventToHost(_ eventName: String, properties: [AnyHashable: Any]) -> Void {
10801085
post.managedObjectContext?.perform {
10811086
WPAnalytics.trackBlockEditorEvent(eventName, properties: properties, blog: self.post.blog)
10821087
}
10831088
}
10841089
}
10851090

1091+
// MARK: - NetworkAwareUI NetworkStatusDelegate
1092+
1093+
extension GutenbergViewController: NetworkStatusDelegate {
1094+
func networkStatusDidChange(active: Bool) {
1095+
gutenberg.connectionStatusChange(isConnected: active)
1096+
}
1097+
}
1098+
10861099
// MARK: - Suggestions implementation
10871100

10881101
extension GutenbergViewController {

0 commit comments

Comments
 (0)