diff --git a/apple/OmnivoreKit/Sources/App/Views/RootView/RootView.swift b/apple/OmnivoreKit/Sources/App/Views/RootView/RootView.swift index 62a77584a..7260e6bab 100644 --- a/apple/OmnivoreKit/Sources/App/Views/RootView/RootView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/RootView/RootView.swift @@ -49,7 +49,7 @@ struct InnerRootView: View { @ObservedObject var viewModel: RootViewModel @ViewBuilder private var innerBody: some View { - if authenticator.isLoggedIn { + if authenticator.isLoggedIn, dataService.appEnvironment.environmentConfigured { PrimaryContentView() .task { try? await dataService.syncOfflineItemsWithServerIfNeeded() diff --git a/apple/OmnivoreKit/Sources/Models/AppEnvironment.swift b/apple/OmnivoreKit/Sources/Models/AppEnvironment.swift index 854059f41..b57f6bf81 100644 --- a/apple/OmnivoreKit/Sources/Models/AppEnvironment.swift +++ b/apple/OmnivoreKit/Sources/Models/AppEnvironment.swift @@ -54,6 +54,17 @@ public extension AppEnvironment { ) } + var environmentConfigured: Bool { + if self == .custom { + if let str = UserDefaults.standard.string(forKey: AppEnvironmentUserDefaultKey.webAppBaseURL.rawValue), let url = URL(string: str) { + return true + } else { + return false + } + } + return true + } + var graphqlPath: String { "\(serverBaseURL.absoluteString)/api/graphql" }