-
Notifications
You must be signed in to change notification settings - Fork 35
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
My courses implicit update #237
Conversation
Stepic/CardsStepsPresenter.swift
Outdated
@@ -109,6 +109,10 @@ class CardsStepsPresenter { | |||
view?.updateProgress(rating: rating, prevMaxRating: AdaptiveRatingHelper.getRating(for: currentLevel - 1), maxRating: AdaptiveRatingHelper.getRating(for: currentLevel), level: currentLevel) | |||
} | |||
|
|||
func didAppear() { | |||
LocalProgressLastViewedUpdater.shared.updateView(for: course) |
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.
Зачем здесь обновлять, если мы обновляем каждый раз в презентере каждого степа?
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.
Здесь это нужно, а вот в CardStepViewController
- нет
@@ -95,6 +95,7 @@ class LastStepRouter { | |||
navigationController.pushViewController(sectionsVC, animated: false) | |||
navigationController.pushViewController(unitsVC, animated: false) | |||
navigationController.pushViewController(lessonVC, animated: true) | |||
LocalProgressLastViewedUpdater.shared.updateView(for: course) |
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.
Для адаптивных курсов мы почему-то обновляем в презентере контроллера с адаптивными степами, а для обычных – в LastStepRouter. К тому же выше здесь есть код навигации к адаптивному степу.
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.
При роутинге на LastStep у нас не всегда прогружены sections и units для курса, соответственно мы не можем по цепочке вверх проставить все
class LocalProgressLastViewedUpdater { | ||
|
||
//Singletons are bad, I know | ||
//TODO: Remove this, add dependencies to objects everywhere |
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.
Возможно, пора снова подумать про DI.
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.
Да, уберу shared там, где он не нужен
Задача: #APPS-1723
Коротко для Release Notes, в формате «Сделали/Добавили/Исправили N»:
Сделали локальное обновление Last Viewed для прогрессов в уроке.
Описание:
В
LocalProgressLastViewedUpdater
обновляются записи lastViewed для всех прогрессов вверх, начиная со степа. ВCourseListPresenter
теперь поwillAppear()
сортируем по последнему просмотру.