Add a feature flag for automatic back pagination. (#5445)
This commit is contained in:
@@ -80,6 +80,7 @@ final class AppSettings {
|
||||
case focusEventOnNotificationTap
|
||||
case linkNewDeviceEnabled
|
||||
case liveLocationSharingEnabled
|
||||
case automaticBackPaginationEnabled
|
||||
|
||||
// Doug's tweaks 🔧
|
||||
case hideUnreadMessagesBadge
|
||||
@@ -447,6 +448,9 @@ final class AppSettings {
|
||||
|
||||
let verifyWithClassicEnabled = appBuildType != .release
|
||||
|
||||
@UserPreference(key: UserDefaultsKeys.automaticBackPaginationEnabled, defaultValue: false, storageType: .userDefaults(store))
|
||||
var automaticBackPaginationEnabled
|
||||
|
||||
@UserPreference(key: UserDefaultsKeys.developerOptionsEnabled, defaultValue: appBuildType == .debug, storageType: .userDefaults(store))
|
||||
var developerOptionsEnabled
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ protocol DeveloperOptionsProtocol: AnyObject {
|
||||
var enableKeyShareOnInvite: Bool { get set }
|
||||
var hideQuietNotificationAlerts: Bool { get set }
|
||||
var focusEventOnNotificationTap: Bool { get set }
|
||||
var automaticBackPaginationEnabled: Bool { get set }
|
||||
|
||||
var hideUnreadMessagesBadge: Bool { get set }
|
||||
var elementCallBaseURLOverride: URL? { get set }
|
||||
|
||||
@@ -67,6 +67,11 @@ struct DeveloperOptionsScreen: View {
|
||||
Toggle(isOn: $context.lowPriorityFilterEnabled) {
|
||||
Text("Low priority filter")
|
||||
}
|
||||
|
||||
Toggle(isOn: $context.automaticBackPaginationEnabled) {
|
||||
Text("Automatic back pagination")
|
||||
Text("Requires app reboot")
|
||||
}
|
||||
}
|
||||
|
||||
Section("Room") {
|
||||
@@ -135,6 +140,7 @@ struct DeveloperOptionsScreen: View {
|
||||
Text("Hide quiet alerts")
|
||||
Text("The badge count will still be updated")
|
||||
}
|
||||
|
||||
Toggle(isOn: $context.focusEventOnNotificationTap) {
|
||||
Text("Focus event on notification tap")
|
||||
}
|
||||
|
||||
@@ -201,6 +201,11 @@ class ClientProxy: ClientProxyProtocol {
|
||||
self.appSettings = appSettings
|
||||
self.analyticsService = analyticsService
|
||||
|
||||
if appSettings.automaticBackPaginationEnabled {
|
||||
// Must be called before creating the sync service, timelines etc.
|
||||
client.enableAutomaticBackpagination()
|
||||
}
|
||||
|
||||
clientQueue = .init(label: "ClientProxyQueue", attributes: .concurrent)
|
||||
|
||||
mediaLoader = MediaLoader(client: client)
|
||||
|
||||
Reference in New Issue
Block a user