Skip to content

Commit fe5c8f7

Browse files
committed
Remove unused setup method
1 parent 109fc5f commit fe5c8f7

File tree

2 files changed

+1
-35
lines changed

2 files changed

+1
-35
lines changed

ios/Demo-iOS/Sources/Views/AppRootView.swift

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ struct AppRootView: View {
7676
let canUsePlugins = apiRoot.hasRoute(route: "/wpcom/v2/editor-assets")
7777
let canUseEditorStyles = apiRoot.hasRoute(route: "/wp-block-editor/v1/settings")
7878

79-
var updatedConfiguration = EditorConfigurationBuilder()
79+
self.activeEditorConfiguration = EditorConfigurationBuilder()
8080
.setShouldUseThemeStyles(canUseEditorStyles)
8181
.setShouldUsePlugins(canUsePlugins)
8282
.setSiteUrl(config.siteUrl)
@@ -86,21 +86,6 @@ struct AppRootView: View {
8686
.setLogLevel(.debug)
8787
.setEnableNetworkLogging(true)
8888
.build()
89-
90-
if let baseURL = URL(string: config.siteApiRoot) {
91-
let service = EditorService(
92-
siteURL: config.siteUrl,
93-
networkSession: URLSession.shared
94-
)
95-
96-
do {
97-
try await service.setup(&updatedConfiguration)
98-
} catch {
99-
print("Failed to setup editor environment, confinuing with the default or cached configuration:", error)
100-
}
101-
}
102-
103-
self.activeEditorConfiguration = updatedConfiguration
10489
} catch {
10590
self.hasError = true
10691
self.error = AppError(errorDescription: error.localizedDescription)

ios/Sources/GutenbergKit/Sources/Service/EditorService.swift

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -197,25 +197,6 @@ public actor EditorService {
197197
log(.info, "Editor refresh completed in \(String(format: "%.2f", totalTime))s")
198198
}
199199

200-
/// Set up the editor for the given site.
201-
///
202-
/// - warning: The request make take a significant amount of time the first
203-
/// time you open the editor.
204-
public func setup(_ configuration: inout EditorConfiguration) async throws {
205-
var builder = configuration.toBuilder()
206-
207-
if !isEditorLoaded {
208-
try await refresh(configuration: configuration)
209-
}
210-
211-
if let data = try? Data(contentsOf: editorSettingsFileURL),
212-
let settings = String(data: data, encoding: .utf8) {
213-
builder = builder.setEditorSettings(settings)
214-
}
215-
216-
return configuration = builder.build()
217-
}
218-
219200
// MARK: – Editor Settings
220201

221202
/// Fetches block editor settings from the WordPress REST API

0 commit comments

Comments
 (0)