From f4a3db09629039e145f479af86b3abdaf9eb09cb Mon Sep 17 00:00:00 2001 From: Dominik Kapusta Date: Thu, 14 Sep 2023 18:17:53 +0200 Subject: [PATCH] Use Development environment for Sync by default in Debug builds (#2013) 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. --- DuckDuckGo/AppDelegate.swift | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/DuckDuckGo/AppDelegate.swift b/DuckDuckGo/AppDelegate.swift index 7caf675ebd..91ebd47063 100644 --- a/DuckDuckGo/AppDelegate.swift +++ b/DuckDuckGo/AppDelegate.swift @@ -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)