-
Notifications
You must be signed in to change notification settings - Fork 34
Last step redirect after join a course #288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Stepic/SectionsAPI.swift
Outdated
| class SectionsAPI: APIEndpoint { | ||
| override var name: String { return "sections" } | ||
|
|
||
| func retrieve(ids: [Int], existing: [Section], headers: [String: String] = AuthInfo.shared.initialHTTPHeaders) -> Promise<[Section]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Зачем тут headers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Видимо незачем после рефакторинга? Сигнатуру взял из какого-то другого класса с API.
Stepic/LastStepRouter.swift
Outdated
|
|
||
| guard let unitId = course.lastStep?.unitId else { | ||
| openSyllabus() | ||
| // If last step does not exists then take first section and its first unit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exists -> exist, опечатка
Stepic/LastStepRouter.swift
Outdated
| if let stepId = course.lastStep?.stepId { | ||
| fulfill(stepId) | ||
| } else { | ||
| let cachedLesson = Lesson.getLesson(unit.lessonId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Думаю, здесь лучше будет выглядеть cachedLesson = unit.lesson
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Давай здесь все-таки сделаем что-то вроде let cachedLesson = unit.lesson ?? Lesson.getlesson(unit.lessonId)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Готово!
| let cachedLesson = Lesson.getLesson(unit.lessonId) | ||
| ApiDataDownloader.lessons.retrieve(ids: [unit.lessonId], existing: cachedLesson == nil ? [] : [cachedLesson!]).then { lesson -> Void in | ||
| if let firstStepId = lesson.first?.stepsArray.first { | ||
| fulfill(firstStepId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А здесь хорошо было бы присвоить unit.lesson = lesson
Задача: #APPS-1871
Коротко для Release Notes, в формате «Сделали/Добавили/Исправили N»:
Добавили переход к последнему пройденному шагу после записи на курс
Описание:
Вместо презентации секций используем везде после записи LastStepRouter. На странице "о курсе" теперь используется CourseSubscriber.