Merge branch 'dev' into ipad-landscape-support

This commit is contained in:
Ryan Zhao 2022-10-11 14:35:04 +11:00
commit 9a5c7632c7
4 changed files with 14 additions and 43 deletions

View file

@ -6020,7 +6020,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 380;
CURRENT_PROJECT_VERSION = 383;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = SUQ8J2PCT7;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
@ -6093,7 +6093,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 380;
CURRENT_PROJECT_VERSION = 383;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = SUQ8J2PCT7;
ENABLE_NS_ASSERTIONS = NO;
@ -6159,7 +6159,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 380;
CURRENT_PROJECT_VERSION = 383;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = SUQ8J2PCT7;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
@ -6233,7 +6233,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 380;
CURRENT_PROJECT_VERSION = 383;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = SUQ8J2PCT7;
ENABLE_NS_ASSERTIONS = NO;
@ -7161,7 +7161,7 @@
CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 380;
CURRENT_PROJECT_VERSION = 383;
DEVELOPMENT_TEAM = SUQ8J2PCT7;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -7233,7 +7233,7 @@
CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 380;
CURRENT_PROJECT_VERSION = 383;
DEVELOPMENT_TEAM = SUQ8J2PCT7;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",

View file

@ -249,7 +249,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

View file

@ -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(

View file

@ -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 {