Skip to content

Commit

Permalink
Implement the new Space selector bottom sheet #6410
Browse files Browse the repository at this point in the history
- Added some comments
  • Loading branch information
gileluard committed Aug 5, 2022
1 parent f573a69 commit 0764e11
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ class AllChatsEditActionProvider {

// MARK: - Public

/// Returns an instance of the updated menu accordingly to the given parameters.
///
/// Some menu items can be disabled depending on the required power levels of the `parentSpace`. Therefore, `updateMenu()` first returns a temporary context menu
/// with all sensible items disabled, asynchronously fetches power levels of the `parentSpace`, then gives a new instance of the menu with, potentially, all sensible items
/// enabled via the `completion` callback.
///
/// - Parameters:
/// - session: The current `MXSession` instance
/// - parentSpace: The current parent space (`nil` for home space)
/// - completion: callback called once the power levels of the `parentSpace` have been fetched and the menu items have been computed accordingly.
/// - Returns: If the `parentSpace` is `nil`, the context menu, the temporary context menu otherwise.
func updateMenu(with session: MXSession?, parentSpace: MXSpace?, completion: @escaping (UIMenu) -> Void) -> UIMenu {
self.parentSpace = parentSpace
isInviteAvailable = false
Expand Down

0 comments on commit 0764e11

Please sign in to comment.