Skip to content

Commit 778a636

Browse files
committed
[#693] Resolve comments
1 parent 2c1c3ee commit 778a636

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

template/Modules/Data/Sources/AppConfig/AppConfig.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ public final class AppConfig<DecodedConfig: Sendable>: AppConfigProtocol {
2828
private var remoteConfig: RemoteConfig?
2929
private let defaultConfig: AppDefaultConfig
3030
private let configMapper: (RemoteConfigDecoder) -> DecodedConfig
31-
32-
public let currentConfigSubject: CurrentValueSubject<DecodedConfig, Never>
31+
private let currentConfigSubject: CurrentValueSubject<DecodedConfig, Never>
3332

3433
public var currentConfigPublisher: AnyPublisher<DecodedConfig, Never> {
3534
currentConfigSubject.eraseToAnyPublisher()

template/Modules/Data/Sources/AppConfig/FirebaseRemoteConfigSource.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010

1111
/// Abstracts the Firebase `RemoteConfig` API surface used by `FirebaseRemoteConfigSource`,
1212
/// enabling the class to be tested without subclassing the Firebase singleton.
13-
protocol RemoteConfigInterface {
13+
protocol RemoteConfigInterface: Sendable {
1414
func fetchAndActivate(completionHandler: ((RemoteConfigFetchAndActivateStatus, (any Error)?) -> Void)?)
1515
func configEntry(forKey key: String) -> (data: Data, source: FirebaseRemoteConfig.RemoteConfigSource)
1616
}
@@ -56,10 +56,6 @@ public final class FirebaseRemoteConfigSource: RemoteConfigSource {
5656
guard source != .static || !data.isEmpty else {
5757
return nil
5858
}
59-
60-
guard !data.isEmpty else {
61-
return nil
62-
}
6359

6460
if let string = String(data: data, encoding: .utf8) {
6561
if let boolValue = string.normalizedRemoteConfigBoolean {
@@ -87,9 +83,9 @@ private extension String {
8783

8884
var normalizedRemoteConfigBoolean: Bool? {
8985
switch trimmingCharacters(in: .whitespacesAndNewlines).lowercased() {
90-
case "1", "true", "yes", "y", "on":
86+
case "true", "yes", "y", "on":
9187
return true
92-
case "0", "false", "no", "n", "off":
88+
case "false", "no", "n", "off":
9389
return false
9490
default:
9591
return nil

0 commit comments

Comments
 (0)