Skip to content

Commit

Permalink
Use Development environment for Sync by default in Debug builds (#2013)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/414235014887631/1205489036222324/f

Description:
When running the app from Xcode, use Development environment for Sync by default.
  • Loading branch information
ayoy authored Sep 14, 2023
1 parent a73fbac commit f4a3db0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions DuckDuckGo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,18 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

// MARK: Sync initialisation

#if DEBUG
let defaultEnvironment = ServerEnvironment.development
#else
let defaultEnvironment = ServerEnvironment.production
#endif

let environment = ServerEnvironment(
UserDefaultsWrapper(
key: .syncEnvironment,
defaultValue: ServerEnvironment.production.description
defaultValue: defaultEnvironment.description
).wrappedValue
) ?? .production
) ?? defaultEnvironment

syncDataProviders = SyncDataProviders(bookmarksDatabase: bookmarksDatabase, secureVaultErrorReporter: SecureVaultErrorReporter.shared)
let syncService = DDGSync(dataProvidersSource: syncDataProviders, errorEvents: SyncErrorHandler(), log: .syncLog, environment: environment)
Expand Down

0 comments on commit f4a3db0

Please sign in to comment.