From 8f65cafbc8a3208a218c917fb7cf503f1b242de3 Mon Sep 17 00:00:00 2001 From: Bruno Muniz Azevedo Filho <bruno@elixxir.io> Date: Fri, 12 Aug 2022 01:26:29 -0300 Subject: [PATCH] Added haptic on EULA radio button and fixed some copy --- Package.swift | 3 ++- .../ChatListFeature/ViewModel/ChatListViewModel.swift | 9 ++++++--- .../ContactFeature/Controllers/ContactController.swift | 5 ++++- Sources/Shared/AutoGenerated/Strings.swift | 6 +++--- Sources/Shared/Resources/en.lproj/Localizable.strings | 6 +++--- Sources/TermsFeature/TermsConditionsController.swift | 1 + 6 files changed, 19 insertions(+), 11 deletions(-) diff --git a/Package.swift b/Package.swift index b8f43d82..87d07c65 100644 --- a/Package.swift +++ b/Package.swift @@ -519,7 +519,8 @@ let package = Package( dependencies: [ .target(name: "Theme"), .target(name: "Shared"), - .target(name: "Defaults") + .target(name: "Defaults"), + .target(name: "Presentation"), ] ), .target( diff --git a/Sources/ChatListFeature/ViewModel/ChatListViewModel.swift b/Sources/ChatListFeature/ViewModel/ChatListViewModel.swift index efd5e463..470e9cf3 100644 --- a/Sources/ChatListFeature/ViewModel/ChatListViewModel.swift +++ b/Sources/ChatListFeature/ViewModel/ChatListViewModel.swift @@ -37,7 +37,8 @@ final class ChatListViewModel { } var recentsPublisher: AnyPublisher<RecentsSnapshot, Never> { - session.dbManager.fetchContactsPublisher(.init(isRecent: true)) + let query = Contact.Query(isRecent: true, isBlocked: false, isBanned: false) + return session.dbManager.fetchContactsPublisher(query) .assertNoFailure() .map { let section = SectionId() @@ -49,8 +50,10 @@ final class ChatListViewModel { } var searchPublisher: AnyPublisher<SearchSnapshot, Never> { - Publishers.CombineLatest3( - session.dbManager.fetchContactsPublisher(.init()).assertNoFailure(), + let contactsQuery = Contact.Query(isBlocked: false, isBanned: false) + + return Publishers.CombineLatest3( + session.dbManager.fetchContactsPublisher(contactsQuery).assertNoFailure(), chatsPublisher, searchSubject .removeDuplicates() diff --git a/Sources/ContactFeature/Controllers/ContactController.swift b/Sources/ContactFeature/Controllers/ContactController.swift index c583654e..30dd3f5e 100644 --- a/Sources/ContactFeature/Controllers/ContactController.swift +++ b/Sources/ContactFeature/Controllers/ContactController.swift @@ -33,7 +33,10 @@ public final class ContactController: UIViewController { navigationItem.backButtonTitle = "" statusBarController.style.send(.lightContent) navigationController?.navigationBar - .customize(backgroundColor: Asset.neutralBody.color) + .customize( + backgroundColor: Asset.neutralBody.color, + tint: Asset.neutralWhite.color + ) } public override func viewSafeAreaInsetsDidChange() { diff --git a/Sources/Shared/AutoGenerated/Strings.swift b/Sources/Shared/AutoGenerated/Strings.swift index ee37eb48..d289e0c6 100644 --- a/Sources/Shared/AutoGenerated/Strings.swift +++ b/Sources/Shared/AutoGenerated/Strings.swift @@ -358,7 +358,7 @@ public enum Localized { public static let action = Localized.tr("Localizable", "chat.report.action") /// Cancel public static let cancel = Localized.tr("Localizable", "chat.report.cancel") - /// Reporting this user will block them, delete them from your connections and you won’t see direct messages from them again. In case this user is marked as banned user by us you won’t also see any new group chat msgs from this user + /// Reporting this user will block them, delete them from your connections and you won’t see direct messages from them again. In case this user is marked as banned user by us you also won’t see any new group chat messages from this user public static let subtitle = Localized.tr("Localizable", "chat.report.subtitle") /// Report user public static let title = Localized.tr("Localizable", "chat.report.title") @@ -497,11 +497,11 @@ public enum Localized { public static func description(_ p1: Any) -> String { return Localized.tr("Localizable", "contact.delete.drawer.description", String(describing: p1)) } - /// Delete Connection? + /// Delete and block connection? public static let title = Localized.tr("Localizable", "contact.delete.drawer.title") } public enum Info { - /// Delete Connection + /// Delete and block connection public static let title = Localized.tr("Localizable", "contact.delete.info.title") } } diff --git a/Sources/Shared/Resources/en.lproj/Localizable.strings b/Sources/Shared/Resources/en.lproj/Localizable.strings index 5d910155..91c5cfb7 100644 --- a/Sources/Shared/Resources/en.lproj/Localizable.strings +++ b/Sources/Shared/Resources/en.lproj/Localizable.strings @@ -183,7 +183,7 @@ "chat.report.title" = "Report user"; "chat.report.subtitle" -= "Reporting this user will block them, delete them from your connections and you won’t see direct messages from them again. In case this user is marked as banned user by us you won’t also see any new group chat msgs from this user"; += "Reporting this user will block them, delete them from your connections and you won’t see direct messages from them again. In case this user is marked as banned user by us you also won’t see any new group chat messages from this user"; "chat.report.action" = "Confirm and Report"; "chat.report.cancel" @@ -258,9 +258,9 @@ // ContactFeature - Delete "contact.delete.info.title" -= "Delete Connection"; += "Delete and block connection"; "contact.delete.drawer.title" -= "Delete Connection?"; += "Delete and block connection?"; "contact.delete.drawer.description" = "This is a silent deletion, %@ will not know you deleted them. This action will remove all information on your phone about this user, including your communications. You #cannot undo this step, and cannot re-add them unless they delete you as a connection as well.#"; diff --git a/Sources/TermsFeature/TermsConditionsController.swift b/Sources/TermsFeature/TermsConditionsController.swift index 34a3a1be..7f7893e3 100644 --- a/Sources/TermsFeature/TermsConditionsController.swift +++ b/Sources/TermsFeature/TermsConditionsController.swift @@ -44,6 +44,7 @@ public final class TermsConditionsController: UIViewController { .sink { [unowned self] in screenView.radioComponent.isEnabled.toggle() screenView.nextButton.isEnabled = screenView.radioComponent.isEnabled + UIImpactFeedbackGenerator(style: .heavy).impactOccurred() }.store(in: &cancellables) screenView.nextButton -- GitLab