mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Clear cache on changing the threads FF (#4581)
* clear cache on changing the threads FF # Conflicts: # PreviewTests/Sources/__Snapshots__/PreviewTests/labsScreen.iPad-pseudo-0.png # PreviewTests/Sources/__Snapshots__/PreviewTests/labsScreen.iPhone-16-pseudo-0.png * fix tests
This commit is contained in:
@@ -14,14 +14,35 @@ struct LabsScreenCoordinatorParameters {
|
||||
let appSettings: AppSettings
|
||||
}
|
||||
|
||||
enum LabsScreenCoordinatorAction {
|
||||
case clearCache
|
||||
}
|
||||
|
||||
final class LabsScreenCoordinator: CoordinatorProtocol {
|
||||
private let viewModel: LabsScreenViewModelProtocol
|
||||
|
||||
private let actionsSubject: PassthroughSubject<LabsScreenCoordinatorAction, Never> = .init()
|
||||
var actions: AnyPublisher<LabsScreenCoordinatorAction, Never> {
|
||||
actionsSubject.eraseToAnyPublisher()
|
||||
}
|
||||
|
||||
private var cancellables = Set<AnyCancellable>()
|
||||
|
||||
init(parameters: LabsScreenCoordinatorParameters) {
|
||||
viewModel = LabsScreenViewModel(labsOptions: parameters.appSettings)
|
||||
}
|
||||
|
||||
func start() { }
|
||||
func start() {
|
||||
viewModel
|
||||
.actionsPublisher
|
||||
.sink { [weak self] action in
|
||||
switch action {
|
||||
case .clearCache:
|
||||
self?.actionsSubject.send(.clearCache)
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
func toPresentable() -> AnyView {
|
||||
AnyView(LabsScreen(context: viewModel.context))
|
||||
|
||||
Reference in New Issue
Block a user