Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: showing/hiding empty conversation list placeholder - WPB-14386 #2192

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,8 @@ final class MockConversationListContainer: UIViewController, ConversationListCon
) {
// no-op
}

func conversationListViewControllerViewModelDidReloadContent(_ viewModel: ConversationListViewController.ViewModel) {
// no - op
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
}
}

func conversationListViewControllerViewModelDidReloadContent(_ viewModel: ViewModel) {
configureEmptyPlaceholder()
}

func conversationListViewControllerViewModelRequiresUpdatingLegalHoldIndictor(_ viewModel: ViewModel) {
if mainSplitViewState == .collapsed {
setupLeftNavigationBarButtonItems()
Expand Down Expand Up @@ -176,7 +180,7 @@
systemName: "line.3.horizontal.decrease.circle.fill",
withConfiguration: symbolConfiguration
)!

Check warning on line 183 in wire-ios/Wire-iOS/Sources/UserInterface/ConversationList/Container/ConversationListViewController+NavigationBar/ConversationListViewController+NavigationBar.swift

View workflow job for this annotation

GitHub Actions / Test Results

Variable 'selectedFilterImage' was never mutated; consider changing to 'let' constant

Variable 'selectedFilterImage' was never mutated; consider changing to 'let' constant
var selectedFilterImage: UIImage = switch listContentController.listViewModel.selectedFilter {
case .favorites, .groups, .oneOnOne, .folder:
filledFilterImage
Expand Down Expand Up @@ -256,7 +260,7 @@
SemanticColors.Button.borderBarItem.resolvedColor(with: traitCollection),
for: .normal
)
newConversationBarButton.layer.cornerRadius = 12

Check warning on line 263 in wire-ios/Wire-iOS/Sources/UserInterface/ConversationList/Container/ConversationListViewController+NavigationBar/ConversationListViewController+NavigationBar.swift

View workflow job for this annotation

GitHub Actions / Test Results

'contentEdgeInsets' was deprecated in iOS 15.0: This property is ignored when using UIButtonConfiguration

'contentEdgeInsets' was deprecated in iOS 15.0: This property is ignored when using UIButtonConfiguration
newConversationBarButton.contentEdgeInsets = UIEdgeInsets(top: 8, left: 12, bottom: 8, right: 12)
newConversationBarButton.bounds.size = newConversationBarButton.systemLayoutSizeFitting(CGSize(
width: .max,
Expand Down Expand Up @@ -428,7 +432,7 @@
guard case .pending = viewModel.selfUserLegalHoldSubject.legalHoldStatus else {
return
}

Check warning on line 435 in wire-ios/Wire-iOS/Sources/UserInterface/ConversationList/Container/ConversationListViewController+NavigationBar/ConversationListViewController+NavigationBar.swift

View workflow job for this annotation

GitHub Actions / Test Results

'shared' is deprecated: Please don't access this property, it will be deleted.

'shared' is deprecated: Please don't access this property, it will be deleted.
ZClientViewController.shared?.legalHoldDisclosureController?.discloseCurrentState(cause: .userAction)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ extension ConversationListViewController.ViewModel: ConversationListContentDeleg
) {
showActionMenu(for: conversation, from: sourceView)
}

func conversationListContentControllerDidReload(_ controller: ConversationListContentController) {
viewController?.conversationListViewControllerViewModelDidReloadContent(self)
}
}

extension ConversationListViewController.ViewModel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
_ viewModel: ConversationListViewController
.ViewModel
)

func conversationListViewControllerViewModelDidReloadContent(
_ viewModel: ConversationListViewController.ViewModel
)
}

extension ConversationListViewController {
Expand Down Expand Up @@ -154,7 +158,7 @@
extension ConversationListViewController.ViewModel {

func setupObservers() {

Check warning on line 161 in wire-ios/Wire-iOS/Sources/UserInterface/ConversationList/Container/ViewModel/ConversationListViewControllerViewModel.swift

View workflow job for this annotation

GitHub Actions / Test Results

'shared()' is deprecated: This shared instance has been deprecated. Don't use it.

'shared()' is deprecated: This shared instance has been deprecated. Don't use it.
if let userSession = ZMUserSession.shared() {
userObservationToken = userSession.addUserObserver(self, for: selfUserLegalHoldSubject)

Expand Down Expand Up @@ -286,7 +290,7 @@

extension ConversationListViewController.ViewModel: UserObserving {

@MainActor

Check warning on line 293 in wire-ios/Wire-iOS/Sources/UserInterface/ConversationList/Container/ViewModel/ConversationListViewControllerViewModel.swift

View workflow job for this annotation

GitHub Actions / Test Results

Main actor-isolated instance method 'userDidChange' cannot be used to satisfy nonisolated protocol requirement; this is an error in the Swift 6 language mode

Main actor-isolated instance method 'userDidChange' cannot be used to satisfy nonisolated protocol requirement; this is an error in the Swift 6 language mode
func userDidChange(_ changeInfo: UserChangeInfo) {

if changeInfo.nameChanged || changeInfo.imageMediumDataChanged || changeInfo
Expand Down Expand Up @@ -321,7 +325,7 @@

extension ConversationListViewController.ViewModel: TeamObserver {

@MainActor

Check warning on line 328 in wire-ios/Wire-iOS/Sources/UserInterface/ConversationList/Container/ViewModel/ConversationListViewControllerViewModel.swift

View workflow job for this annotation

GitHub Actions / Test Results

Main actor-isolated instance method 'teamDidChange' cannot be used to satisfy nonisolated protocol requirement; this is an error in the Swift 6 language mode

Main actor-isolated instance method 'teamDidChange' cannot be used to satisfy nonisolated protocol requirement; this is an error in the Swift 6 language mode
func teamDidChange(_ changeInfo: TeamChangeInfo) {

if changeInfo.imageDataChanged {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
guard let conversation = listViewModel.item(for: indexPath) as? ZMConversation else {
return nil
}

Check warning on line 304 in wire-ios/Wire-iOS/Sources/UserInterface/ConversationList/ListContent/ConversationListContentController/ConversationListContentController.swift

View workflow job for this annotation

GitHub Actions / Test Results

Immutable value 'previewProvider' was never used; consider replacing with '_' or removing it

Immutable value 'previewProvider' was never used; consider replacing with '_' or removing it
let previewProvider: UIContextMenuContentPreviewProvider = {
ConversationPreviewViewController(
conversation: conversation,
Expand Down Expand Up @@ -471,6 +471,7 @@
let reloadClosure = {
self.collectionView.reloadSections(IndexSet(integer: section))
self.ensureCurrentSelection()
self.contentDelegate?.conversationListContentControllerDidReload(self)
}

if animated {
Expand All @@ -490,6 +491,7 @@
setData: (C?) -> Void
) {
collectionView.reload(using: stagedChangeset, interrupt: interrupt, setData: setData)
contentDelegate?.conversationListContentControllerDidReload(self)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,20 @@
import WireDataModel

protocol ConversationListContentDelegate: AnyObject {

func conversationList(
_ controller: ConversationListContentController?,
didSelect conversation: ZMConversation?,
focusOnView focus: Bool
)

func conversationListContentController(
_ controller: ConversationListContentController?,
wantsActionMenuFor conversation: ZMConversation?,
fromSourceView sourceView: UIView?
)

func conversationListContentControllerDidReload(
_ controller: ConversationListContentController
)
}
Loading