Knock Requests banner display logic (#3550)

* added the join rule to the info

* update SDK and added logic to display the banner

in the room screen

* added the logic to display the banner
This commit is contained in:
Mauro
2024-11-25 13:14:02 +01:00
committed by GitHub
parent 9180bac13c
commit 26e07f2457
16 changed files with 131 additions and 42 deletions
@@ -11,9 +11,17 @@ enum KnockRequestsListScreenViewModelAction { }
struct KnockRequestsListScreenViewState: BindableState {
var requests: [KnockRequestCellInfo] = []
var canAccept = false
var canDecline = false
var canBan = false
// If you are in this view one of these must have been true so by default we assume all of them to be true
var canAccept = true
var canDecline = true
var canBan = true
var isKnockableRoom = true
// If all the permissions are denied or the join rule changes while we are in the view
// we want to stop displaying any request
var shouldDisplayRequests: Bool {
!requests.isEmpty && isKnockableRoom && (canAccept || canDecline || canBan)
}
}
enum KnockRequestsListScreenViewAction {