Skip to content

Commit

Permalink
[Spaces] M10.8 Browsing users in a space #4682
Browse files Browse the repository at this point in the history
- Update after code review
  • Loading branch information
gileluard committed Sep 14, 2021
1 parent c2e4d91 commit f4fb4be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Riot/Managers/UserSessions/UserSessionsService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ extension UserSessionsService {
@objcMembers
class UserSessionsService: NSObject {

// MARK: - Singleton

static public let shared: UserSessionsService = UserSessionsService()

// MARK: - Properties

// MARK: Private
Expand Down
2 changes: 1 addition & 1 deletion Riot/Modules/Application/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ final class AppCoordinator: NSObject, AppCoordinatorType {
init(router: RootRouterType, window: UIWindow) {
self.rootRouter = router
self.customSchemeURLParser = CustomSchemeURLParser()
self.userSessionsService = UserSessionsService()
self.userSessionsService = UserSessionsService.shared

super.init()

Expand Down
4 changes: 1 addition & 3 deletions Riot/Modules/People/PeopleViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ @interface PeopleViewController () <SpaceMembersCoordinatorBridgePresenterDelega
{
NSInteger directRoomsSectionNumber;
RecentsDataSource *recentsDataSource;
UserSessionsService *userSessionsService;
}

@property(nonatomic) SpaceMembersCoordinatorBridgePresenter *spaceMembersCoordinatorBridgePresenter;
Expand All @@ -51,7 +50,6 @@ - (void)finalizeInit
[super finalizeInit];

directRoomsSectionNumber = 0;
userSessionsService = [UserSessionsService new];

self.screenName = @"People";
}
Expand Down Expand Up @@ -125,7 +123,7 @@ - (void)onPlusButtonPressed
{
if (self.dataSource.currentSpace != nil)
{
self.spaceMembersCoordinatorBridgePresenter = [[SpaceMembersCoordinatorBridgePresenter alloc] initWithUserSessionsService:userSessionsService session:self.mainSession spaceId:self.dataSource.currentSpace.spaceId];
self.spaceMembersCoordinatorBridgePresenter = [[SpaceMembersCoordinatorBridgePresenter alloc] initWithUserSessionsService:[UserSessionsService shared] session:self.mainSession spaceId:self.dataSource.currentSpace.spaceId];
self.spaceMembersCoordinatorBridgePresenter.delegate = self;
[self.spaceMembersCoordinatorBridgePresenter presentFrom:self animated:YES];
}
Expand Down

0 comments on commit f4fb4be

Please sign in to comment.