Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ struct OAuthTokenResult: Codable {
}
}

final class KeychainHelper: Sendable {
@MainActor
final class KeychainHelper {
static let shared = KeychainHelper()

private let logger = OSLogger(prefix: "Keychain", logLevel: ShopifyCheckoutKit.configuration.logLevel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,12 @@ public enum EnvironmentVariables {
}

private static func getKey(for key: String) -> String {
guard let value = EnvironmentVariables.infoDictionary[key] as? String else {
guard let value = Bundle.main.infoDictionary?[key] as? String else {
fatalError("Environment variable \(key) must be set in the Storefront.xcconfig file")
}
return value
}

private static let infoDictionary: [String: Any] = {
guard let dict = Bundle.main.infoDictionary else {
fatalError("Plist file not found")
}
return dict
}()

public static let storefrontAccessToken: String = getKey(for: Keys.storefrontAccessToken)

public static let storefrontDomain: String = getKey(for: Keys.storefrontDomain)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ typealias ProductVariants = Storefront.GetProductsQuery.Data.Products.Node.Varia
typealias ProductVariant = Storefront.GetProductsQuery.Data.Products.Node.Variants.Node
typealias ProductPrice = Storefront.GetProductsQuery.Data.Products.Node.Variants.Node.Price

class Network {
@MainActor
final class Network {
static let shared = Network()

/// Get the device's language code mapped to Shopify's LanguageCode enum
Expand Down
Loading