diff --git a/DuckDuckGo/NetworkProtectionStatusView.swift b/DuckDuckGo/NetworkProtectionStatusView.swift index 953881fd00..ffd1ace366 100644 --- a/DuckDuckGo/NetworkProtectionStatusView.swift +++ b/DuckDuckGo/NetworkProtectionStatusView.swift @@ -248,7 +248,7 @@ private struct NetworkProtectionErrorView: View { .daxBodyRegular() .foregroundColor(.primary) } - .listRowBackground(Color(designSystemColor: .accent)) + .listRowBackground(Color(designSystemColor: .surface)) } } diff --git a/DuckDuckGo/NetworkProtectionStatusViewModel.swift b/DuckDuckGo/NetworkProtectionStatusViewModel.swift index 904eb97fc0..0d317bbdcb 100644 --- a/DuckDuckGo/NetworkProtectionStatusViewModel.swift +++ b/DuckDuckGo/NetworkProtectionStatusViewModel.swift @@ -166,6 +166,7 @@ final class NetworkProtectionStatusViewModel: ObservableObject { setUpServerInfoPublishers() setUpLocationPublishers() setUpThroughputRefreshTimer() + setUpErrorPublishers() // Prefetching this now for snappy load times on the locations screens Task { @@ -288,6 +289,24 @@ final class NetworkProtectionStatusViewModel: ObservableObject { .store(in: &cancellables) } + private func setUpErrorPublishers() { + guard AppDependencyProvider.shared.internalUserDecider.isInternalUser else { + return + } + + errorObserver.publisher + .map { errorMessage in + guard let errorMessage else { + return nil + } + + return ErrorItem(title: "Failed to Connect", message: errorMessage) + } + .receive(on: DispatchQueue.main) + .assign(to: \.error, onWeaklyHeld: self) + .store(in: &cancellables) + } + private func setUpLocationPublishers() { settings.selectedLocationPublisher .receive(on: DispatchQueue.main)