Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alfogrillo committed Nov 18, 2022
1 parent a83d54d commit d1e434b
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions Riot/Modules/Home/AllChats/AllChatsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ class AllChatsViewController: HomeViewController {

private var allChatsOnboardingCoordinatorBridgePresenter: AllChatsOnboardingCoordinatorBridgePresenter?

private var session: MXSession? {
UserSessionsService.shared.mainUserSession?.matrixSession
}

private var theme: Theme {
ThemeService.shared().theme
}
Expand Down Expand Up @@ -469,10 +465,10 @@ class AllChatsViewController: HomeViewController {
return
}

self.update()
self.update(with: theme)
}

private func update() {
private func update(with theme: Theme) {
self.navigationController?.toolbar?.tintColor = theme.colors.accent
}

Expand Down Expand Up @@ -528,10 +524,10 @@ class AllChatsViewController: HomeViewController {
guard isViewLoaded else {
return
}
spacesButton.badgeText = session.map {
spacesButton.badgeText = mainSession.map {
"\($0.spaceService.rootSpacesNotificationCount)"
}
spacesButton.badgeBackgroundColor = session.map {
spacesButton.badgeBackgroundColor = mainSession.map {
$0.spaceService.rootSpacesHaveHighlightNotification ? theme.noticeColor : theme.noticeSecondaryColor
} ?? .clear
}
Expand All @@ -542,7 +538,7 @@ class AllChatsViewController: HomeViewController {
}

self.isToolbarHidden = false
self.update()
self.update(with: theme)

self.toolbar.items = [
spacesButton,
Expand Down

0 comments on commit d1e434b

Please sign in to comment.