mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Fixed a couple of bugs with the release
Fixed a bug where you couldn't start a conversation with an ONS Fixed a bug where some dropdown settings wouldn't refresh their UI when returning from an update via a child screen
This commit is contained in:
parent
76536a8293
commit
02e632aae4
|
@ -238,7 +238,7 @@ private final class EnterPublicKeyVC: UIViewController {
|
|||
|
||||
private lazy var publicKeyTextView: TextView = {
|
||||
let result = TextView(placeholder: "vc_enter_public_key_text_field_hint".localized()) { [weak self] text in
|
||||
self?.nextButton.isEnabled = (SessionId(from: text) != nil)
|
||||
self?.nextButton.isEnabled = !text.isEmpty
|
||||
}
|
||||
result.autocapitalizationType = .none
|
||||
|
||||
|
|
|
@ -56,6 +56,11 @@ class NotificationSettingsViewModel: SessionTableViewModel<NoNav, NotificationSe
|
|||
/// just in case the database has changed between the two reads - unfortunately it doesn't look like there is a way to prevent this
|
||||
private lazy var _observableSettingsData: ObservableData = ValueObservation
|
||||
.trackingConstantRegion { db -> [SectionModel] in
|
||||
let notificationSound: Preferences.Sound = db[.defaultNotificationSound]
|
||||
.defaulting(to: Preferences.Sound.defaultNotificationSound)
|
||||
let previewType: Preferences.NotificationPreviewType = db[.preferencesNotificationPreviewType]
|
||||
.defaulting(to: Preferences.NotificationPreviewType.defaultPreviewType)
|
||||
|
||||
return [
|
||||
SectionModel(
|
||||
model: .strategy,
|
||||
|
@ -90,11 +95,7 @@ class NotificationSettingsViewModel: SessionTableViewModel<NoNav, NotificationSe
|
|||
id: .styleSound,
|
||||
title: "NOTIFICATIONS_STYLE_SOUND_TITLE".localized(),
|
||||
rightAccessory: .dropDown(
|
||||
.dynamicString(
|
||||
type: Preferences.Sound.self,
|
||||
key: .defaultNotificationSound,
|
||||
value: { $0.defaulting(to: .defaultNotificationSound).displayName }
|
||||
)
|
||||
.dynamicString { notificationSound.displayName }
|
||||
),
|
||||
onTap: { [weak self] in
|
||||
self?.transitionToScreen(
|
||||
|
@ -122,11 +123,7 @@ class NotificationSettingsViewModel: SessionTableViewModel<NoNav, NotificationSe
|
|||
title: "NOTIFICATIONS_STYLE_CONTENT_TITLE".localized(),
|
||||
subtitle: "NOTIFICATIONS_STYLE_CONTENT_DESCRIPTION".localized(),
|
||||
rightAccessory: .dropDown(
|
||||
.dynamicString(
|
||||
type: Preferences.NotificationPreviewType.self,
|
||||
key: .preferencesNotificationPreviewType,
|
||||
value: { $0.defaulting(to: .defaultPreviewType).name }
|
||||
)
|
||||
.dynamicString { previewType.name }
|
||||
),
|
||||
onTap: { [weak self] in
|
||||
self?.transitionToScreen(
|
||||
|
|
|
@ -222,32 +222,6 @@ extension SessionCell.Accessory {
|
|||
case userDefaults(UserDefaults, key: String)
|
||||
case settingBool(key: Setting.BoolKey)
|
||||
|
||||
// MARK: - Convenience Types
|
||||
|
||||
public static func dynamicString<ET: EnumIntSetting>(
|
||||
type: ET.Type,
|
||||
key: Setting.EnumKey,
|
||||
value: @escaping ((ET?) -> String?)
|
||||
) -> DataSource {
|
||||
return .dynamicString {
|
||||
let currentValue: ET? = Storage.shared[key]
|
||||
|
||||
return value(currentValue)
|
||||
}
|
||||
}
|
||||
|
||||
public static func dynamicString<ET: EnumStringSetting>(
|
||||
type: ET.Type,
|
||||
key: Setting.EnumKey,
|
||||
value: @escaping ((ET?) -> String?)
|
||||
) -> DataSource {
|
||||
return .dynamicString {
|
||||
let currentValue: ET? = Storage.shared[key]
|
||||
|
||||
return value(currentValue)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Convenience
|
||||
|
||||
public var currentBoolValue: Bool {
|
||||
|
|
Loading…
Reference in a new issue