-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Mobile 4660 #4193
Mobile 4660 #4193
Conversation
8805891
to
c007e82
Compare
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.
Taking into account all the problems we're facing here, maybe it would have been better to take a different approach: when we receive the data from WS, we could modify the data to replace all the mod_subection activities with their section, and remove the subsection from the list of sections. That way in section contents we would have modules and sections, and all the app would receive this new structure (there would be no need to filter the list of sections in the page, or calculate module.subsection and so on). For the app, mod_subsection wouldn't exist, only the function converting the WS data would know that there is an activity called mod_subsection.
I guess it's too late now to try this approach, and maybe it causes other problems, so for now I guess it's better to keep your approach.
src/addons/storagemanager/pages/course-storage/course-storage.ts
Outdated
Show resolved
Hide resolved
src/core/features/course/components/course-format/course-format.ts
Outdated
Show resolved
Hide resolved
/** | ||
* Confirm and prefetch a section. If the section is "all sections", prefetch all the sections. | ||
* | ||
* @param section Section to download. | ||
*/ | ||
async prefecthSection(section: AddonStorageManagerCourseSection): Promise<void> { | ||
async prefetchSection(section: AddonStorageManagerCourseSection): Promise<void> { | ||
section.isCalculating = true; | ||
this.changeDetectorRef.markForCheck(); | ||
try { | ||
await CoreCourseHelper.confirmDownloadSizeSection(this.courseId, section, this.sections); |
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.
While testing this I noticed that this function calls CoreCourseModulePrefetchDelegate.getDownloadSize
passing section.modules
, and section.modules
can include a mod_subsection. But subsection don't have a download size, they return -1 (cannot calculate), so for those sections it will always say that the size couldn't be calculated.
3af7299
to
a5598e4
Compare
a5598e4
to
48b45d9
Compare
Closing this PR in favor of #4194, which includes these commits along with others. |
No description provided.