TabBarCoordinator: Prevent to update master tab bar controllers when not needed.

This commit is contained in:
SBiOSoftWhare
2021-10-28 18:15:46 +02:00
parent 623571a493
commit 73f61df90c
+9 -3
View File
@@ -105,9 +105,11 @@ final class TabBarCoordinator: NSObject, TabBarCoordinatorType {
versionCheckCoordinator.start()
add(childCoordinator: versionCheckCoordinator)
}
self.updateMasterTabBarController(with: spaceId, forceReload: true)
} else {
self.updateMasterTabBarController(with: spaceId)
}
self.updateMasterTabBarController(with: spaceId)
}
func toPresentable() -> UIViewController {
@@ -280,7 +282,11 @@ final class TabBarCoordinator: NSObject, TabBarCoordinatorType {
gesture.delegate = self
}
private func updateMasterTabBarController(with spaceId: String?) {
private func updateMasterTabBarController(with spaceId: String?, forceReload: Bool = false) {
if !forceReload && spaceId == self.currentSpaceId {
return
}
self.updateTabControllers(for: self.masterTabBarController, showCommunities: spaceId == nil)
self.masterTabBarController.filterRooms(withParentId: spaceId, inMatrixSession: self.currentMatrixSession)