Make AttractorServer setting nil by default
This commit is contained in:
@@ -169,7 +169,7 @@ class GeneralSettingsViewController: UIViewController
|
||||
cell.contentConfiguration = ButtonContentConfiguration(menu: menu)
|
||||
} else if identifier == Self.SyncServerItem {
|
||||
cell.contentConfiguration = TextFieldContentConfiguration(
|
||||
text: Settings.shared.syncServer,
|
||||
text: Settings.shared.syncServer ?? "",
|
||||
placeholderText: "https://sync.server.com",
|
||||
textChanged: { newString in
|
||||
Settings.shared.syncServer = newString
|
||||
|
||||
@@ -107,5 +107,22 @@ class Settings
|
||||
public var userStylesheet: String = ""
|
||||
|
||||
@SettingProperty(key: "syncServer")
|
||||
public var syncServer: String = "https://attractor.severnaya.net"
|
||||
public var syncServer: Optional<String> = "https://attractor.severnaya.net"
|
||||
}
|
||||
|
||||
extension Optional: RawRepresentable where Wrapped == String
|
||||
{
|
||||
public init?(rawValue: String?) {
|
||||
if let rawValue {
|
||||
self = String(rawValue: rawValue)
|
||||
} else {
|
||||
self = .none
|
||||
}
|
||||
}
|
||||
|
||||
public var rawValue: String? {
|
||||
return self
|
||||
}
|
||||
|
||||
public typealias RawValue = String?
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user