Skip to content

Commit

Permalink
Address review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmed-Naguib93 committed Dec 19, 2024
1 parent 0057e24 commit 9cd3037
Showing 1 changed file with 8 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ final class DashboardViewModel: ObservableObject {

// MARK: - Input

var onEvent: (HorizonUI.NavigationBar.Trailing.Event) -> Void = { _ in}
var viewController: WeakViewController = .init()

// MARK: - Private variables
Expand Down Expand Up @@ -61,8 +60,6 @@ final class DashboardViewModel: ObservableObject {
.map { "Hi, \($0)" }
.replaceError(with: "")
.assign(to: &$title)

configNavigationBarEvents()
}

// MARK: - Inputs
Expand All @@ -77,19 +74,14 @@ final class DashboardViewModel: ObservableObject {

// MARK: - Private Functions

private func configNavigationBarEvents() {
onEvent = { [weak self] event in
guard let self else {
return
}
switch event {
case .mail:
mailDidTap()
case .notebook:
notebookDidTap()
case .notification:
notificationsDidTap()
}
func onEvent(event: HorizonUI.NavigationBar.Trailing.Event) {
switch event {
case .mail:
mailDidTap()
case .notebook:
notebookDidTap()
case .notification:
notificationsDidTap()
}
}
}

0 comments on commit 9cd3037

Please sign in to comment.