Skip to content

Commit

Permalink
refactor: address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
saeedbashir committed Nov 22, 2023
1 parent bda3e89 commit 0b45177
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
3 changes: 2 additions & 1 deletion OpenEdX/View/MainScreenView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ struct MainScreenView: View {
var body: some View {
TabView(selection: $selection) {
ZStack {
DiscoveryView(viewModel: Container.shared.resolve(DiscoveryViewModel.self)!, router: Container.shared.resolve(DiscoveryRouter.self)!)
DiscoveryView(viewModel: Container.shared.resolve(DiscoveryViewModel.self)!,
router: Container.shared.resolve(DiscoveryRouter.self)!)
if updateAvaliable {
UpdateNotificationView(config: viewModel.config)
}
Expand Down
14 changes: 3 additions & 11 deletions Profile/Profile/Presentation/Profile/ProfileViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,9 @@ public class ProfileViewModel: ObservableObject {

@MainActor
func logOut() async {
do {
try await interactor.logOut()
router.showStartupScreen()
analytics.userLogout(force: false)
} catch let error {
if error.isInternetError {
errorMessage = CoreLocalization.Error.slowOrNoInternetConnection
} else {
errorMessage = CoreLocalization.Error.unknownError
}
}
try? await interactor.logOut()
router.showStartupScreen()
analytics.userLogout(force: false)
}

func trackProfileVideoSettingsClicked() {
Expand Down

0 comments on commit 0b45177

Please sign in to comment.