Skip to content

Commit

Permalink
Disable RR extension when feature flag is off (#1068)
Browse files Browse the repository at this point in the history
* disable rr extension according to ff

* fixed typos in the code
  • Loading branch information
Velin92 authored Jun 12, 2023
1 parent 0f358a6 commit 94c97ec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ struct DeveloperOptionsScreen: View {

Toggle(isOn: $context.readReceiptsEnabled) {
Text("Show read receipts")
Text("requires app reboot")
}
.onChange(of: context.readReceiptsEnabled) { _ in
context.send(viewAction: .changedReadReceiptsEnabled)
Expand Down
9 changes: 7 additions & 2 deletions ElementX/Sources/Services/Client/ClientProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,15 @@ class ClientProxy: ClientProxyProtocol {

// Add the visibleRoomsSlidingSyncList here so that it can take advantage of the SS builder cold cache
// We will still register the allRoomsSlidingSyncList later, and than will have no cache
let slidingSync = try slidingSyncBuilder
var slidingSyncBuilderWithExtension = slidingSyncBuilder
.addList(listBuilder: visibleRoomsListBuilder)
.withCommonExtensions()
.build()

if !ServiceLocator.shared.settings.readReceiptsEnabled {
slidingSyncBuilderWithExtension = slidingSyncBuilderWithExtension.withoutReceiptExtension()
}

let slidingSync = try slidingSyncBuilderWithExtension.build()

// Don't forget to update the view proxies after building the slidingSync
visibleRoomsListProxy?.setSlidingSync(slidingSync: slidingSync)
Expand Down

0 comments on commit 94c97ec

Please sign in to comment.