Fix unnecessary V2 open group requests
This commit is contained in:
parent
57848d6701
commit
330e4ce8ad
|
@ -154,7 +154,9 @@ final class HomeVC : BaseVC, UITableViewDataSource, UITableViewDelegate, NewConv
|
|||
let _ = IP2Country.shared.populateCacheIfNeeded()
|
||||
}
|
||||
// Get default open group rooms if needed
|
||||
OpenGroupAPIV2.getDefaultRoomsIfNeeded()
|
||||
if OpenGroupManagerV2.useV2OpenGroups {
|
||||
OpenGroupAPIV2.getDefaultRoomsIfNeeded()
|
||||
}
|
||||
}
|
||||
|
||||
override func viewDidAppear(_ animated: Bool) {
|
||||
|
|
|
@ -411,7 +411,7 @@ static NSTimeInterval launchStartedAt;
|
|||
} requiresSync:YES];
|
||||
}
|
||||
|
||||
if (CurrentAppContext().isMainApp) {
|
||||
if (CurrentAppContext().isMainApp && SNOpenGroupManagerV2.useV2OpenGroups) {
|
||||
[SNOpenGroupAPIV2 getDefaultRoomsIfNeeded];
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ public final class OpenGroupManagerV2 : NSObject {
|
|||
private var pollers: [String:OpenGroupPollerV2] = [:]
|
||||
private var isPolling = false
|
||||
|
||||
public static var useV2OpenGroups = false
|
||||
@objc public static var useV2OpenGroups = false
|
||||
|
||||
// MARK: Initialization
|
||||
@objc public static let shared = OpenGroupManagerV2()
|
||||
|
|
Loading…
Reference in New Issue