Skip to content
Snippets Groups Projects
Commit a9fc1b33 authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Cleanup

parent e836a6e8
No related branches found
No related tags found
3 merge requests!71Releasing v1.1.5 (214),!69Implemented filtering for banned/blocked users and reporting,!67v1.1.5 b(203)
...@@ -49,7 +49,6 @@ public final class SingleChatController: UIViewController { ...@@ -49,7 +49,6 @@ public final class SingleChatController: UIViewController {
private let viewModel: SingleChatViewModel private let viewModel: SingleChatViewModel
private let layoutDelegate = LayoutDelegate() private let layoutDelegate = LayoutDelegate()
private var cancellables = Set<AnyCancellable>() private var cancellables = Set<AnyCancellable>()
private var drawerCancellables = Set<AnyCancellable>()
private var sections = [ArraySection<ChatSection, Message>]() private var sections = [ArraySection<ChatSection, Message>]()
private var currentInterfaceActions: SetActor<Set<InterfaceActions>, ReactionTypes> = SetActor() private var currentInterfaceActions: SetActor<Set<InterfaceActions>, ReactionTypes> = SetActor()
...@@ -385,12 +384,8 @@ public final class SingleChatController: UIViewController { ...@@ -385,12 +384,8 @@ public final class SingleChatController: UIViewController {
button.action button.action
.receive(on: DispatchQueue.main) .receive(on: DispatchQueue.main)
.sink { [weak drawer] in .sink { [unowned drawer] in drawer.dismiss(animated: true) }
drawer?.dismiss(animated: true) { [weak self] in .store(in: &drawer.cancellables)
guard let self = self else { return }
self.drawerCancellables.removeAll()
}
}.store(in: &drawerCancellables)
return drawer return drawer
} }
...@@ -442,21 +437,17 @@ public final class SingleChatController: UIViewController { ...@@ -442,21 +437,17 @@ public final class SingleChatController: UIViewController {
clearButton.publisher(for: .touchUpInside) clearButton.publisher(for: .touchUpInside)
.receive(on: DispatchQueue.main) .receive(on: DispatchQueue.main)
.sink { .sink { [unowned drawer, weak self] in
drawer.dismiss(animated: true) { [weak self] in drawer.dismiss(animated: true) {
guard let self = self else { return } self?.viewModel.didRequestDeleteAll()
self.drawerCancellables.removeAll()
self.viewModel.didRequestDeleteAll()
} }
}.store(in: &drawerCancellables) }
.store(in: &drawer.cancellables)
cancelButton.publisher(for: .touchUpInside) cancelButton.publisher(for: .touchUpInside)
.receive(on: DispatchQueue.main) .receive(on: DispatchQueue.main)
.sink { .sink { [unowned drawer] in drawer.dismiss(animated: true) }
drawer.dismiss(animated: true) { [weak self] in .store(in: &drawer.cancellables)
self?.drawerCancellables.removeAll()
}
}.store(in: &drawerCancellables)
coordinator.toDrawer(drawer, from: self) coordinator.toDrawer(drawer, from: self)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment