mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.2 KiB
Swift
45 lines
1.2 KiB
Swift
1 year ago
|
// Copyright © 2023 Rangeproof Pty Ltd. All rights reserved.
|
||
|
//
|
||
|
// stringlint:disable
|
||
|
|
||
|
import Foundation
|
||
|
|
||
|
// MARK: - FeatureStorage
|
||
|
|
||
|
public extension FeatureStorage {
|
||
|
static let serviceNetwork: FeatureConfig<ServiceNetwork> = Dependencies.create(
|
||
|
identifier: "serviceNetwork"
|
||
|
)
|
||
|
}
|
||
|
|
||
|
// MARK: - ServiceNetwork Feature
|
||
|
|
||
|
public enum ServiceNetwork: Int, FeatureOption {
|
||
|
case mainnet = 1
|
||
|
case testnet = 2
|
||
|
|
||
|
public enum Events: FeatureEvent {
|
||
|
case updatedServiceNetwork
|
||
|
|
||
|
public static var updateValueEvent: Events = .updatedServiceNetwork
|
||
|
}
|
||
|
|
||
|
// MARK: - Feature Option
|
||
|
|
||
|
public static var defaultOption: ServiceNetwork = .mainnet
|
||
|
|
||
|
public var title: String {
|
||
|
switch self {
|
||
|
case .mainnet: return "Mainnet"
|
||
|
case .testnet: return "Testnet"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public var subtitle: String? {
|
||
|
switch self {
|
||
|
case .mainnet: return "This is the production service node network."
|
||
|
case .testnet: return "This is the test service node network, it should be used for testing features which are currently in development and may be unstable."
|
||
|
}
|
||
|
}
|
||
|
}
|