Skip to content

Commit

Permalink
chore: remove refresh course
Browse files Browse the repository at this point in the history
  • Loading branch information
eyatsenkoperpetio committed Feb 2, 2024
1 parent b91cf6d commit 79378bc
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 20 deletions.
1 change: 0 additions & 1 deletion Core/Core/Extensions/Notification.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ public extension Notification.Name {
static let onNewVersionAvaliable = Notification.Name("onNewVersionAvaliable")
static let webviewReloadNotification = Notification.Name("webviewReloadNotification")
static let onBlockCompletion = Notification.Name.init("onBlockCompletion")
static let onRefreshCourse = Notification.Name.init("refreshCourse")
}
10 changes: 0 additions & 10 deletions Course/Course/Presentation/Outline/CourseOutlineView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,6 @@ public struct CourseOutlineView: View {
)
}
}

.onReceive(
NotificationCenter.default.publisher(
for: .onRefreshCourse
)
) { _ in
Task {
await viewModel.getCourseBlocks(courseID: courseID, withProgress: false)
}
}
.onReceive(
NotificationCenter.default.publisher(
for: .onBlockCompletion
Expand Down
6 changes: 0 additions & 6 deletions Course/Course/Presentation/Unit/CourseUnitView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,6 @@ public struct CourseUnitView: View {
NavigationBar(
title: isDropdownActive ? sequenceTitle : "",
leftButtonAction: {
if viewModel.blockChanged {
NotificationCenter.default.post(
name: .onRefreshCourse,
object: nil
)
}
viewModel.router.back()
playerStateSubject.send(VideoPlayerState.kill)
}
Expand Down
3 changes: 0 additions & 3 deletions Course/Course/Presentation/Unit/CourseUnitViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ public class CourseUnitViewModel: ObservableObject {
config.uiComponents.courseUnitProgressEnabled
}

private(set) var blockChanged: Bool = false

public init(
lessonID: String,
courseID: String,
Expand Down Expand Up @@ -272,7 +270,6 @@ public class CourseUnitViewModel: ObservableObject {

private func setBlockCompletionForSelectedLesson() {
verticals[verticalIndex].childs[index].completion = 1.0
blockChanged = true
NotificationCenter.default.post(
name: .onBlockCompletion,
object: nil,
Expand Down

0 comments on commit 79378bc

Please sign in to comment.