Skip to content

Commit ea86d13

Browse files
authored
Fix mozilla-mobile#5585 - Followup. Move leanplum startup to correct location (mozilla-mobile#5699)
1 parent 466570c commit ea86d13

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Client/Application/AppDelegate.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIViewControllerRestorati
221221
// that is an iOS bug or not.
222222
AutocompleteTextField.appearance().semanticContentAttribute = .forceLeftToRight
223223

224+
if let profile = self.profile, LeanPlumClient.shouldEnable(profile: profile) {
225+
LeanPlumClient.shared.setup(profile: profile)
226+
LeanPlumClient.shared.set(enabled: true)
227+
}
228+
224229
return shouldPerformAdditionalDelegateHandling
225230
}
226231

@@ -287,12 +292,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIViewControllerRestorati
287292

288293
UnifiedTelemetry.recordEvent(category: .action, method: .foreground, object: .app)
289294

290-
// - LeanPlum does heavy disk access during init, but crashes if delayed
291-
if let profile = self.profile, LeanPlumClient.shouldEnable(profile: profile) {
292-
LeanPlumClient.shared.setup(profile: profile)
293-
LeanPlumClient.shared.set(enabled: true)
294-
}
295-
296295
// Delay these operations until after UIKit/UIApp init is complete
297296
// - loadQueuedTabs accesses the DB and shows up as a hot path in profiling
298297
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {

0 commit comments

Comments
 (0)