From 3a51b361fd321539906cbd94c7c76aea182cba59 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Wed, 23 Feb 2022 14:47:38 +0100 Subject: [PATCH] MOBILE-3780 core: Fix spinner not shown in forum when refreshing The variable loaded has been renamed to showLoading in index components --- .../components/index/addon-mod-assign-index.html | 7 ++++--- src/addons/mod/assign/pages/index/index.html | 2 +- .../mod/bigbluebuttonbn/components/index/index.html | 5 +++-- .../mod/bigbluebuttonbn/components/index/index.ts | 8 ++++---- src/addons/mod/bigbluebuttonbn/pages/index/index.html | 2 +- .../book/components/index/addon-mod-book-index.html | 5 +++-- src/addons/mod/book/pages/index/index.html | 2 +- .../chat/components/index/addon-mod-chat-index.html | 5 +++-- src/addons/mod/chat/pages/index/index.html | 2 +- .../components/index/addon-mod-choice-index.html | 5 +++-- src/addons/mod/choice/pages/index/index.html | 2 +- .../data/components/index/addon-mod-data-index.html | 5 +++-- src/addons/mod/data/components/index/index.ts | 8 ++++---- src/addons/mod/data/pages/index/index.html | 2 +- .../components/index/addon-mod-feedback-index.html | 5 +++-- src/addons/mod/feedback/components/index/index.ts | 2 +- src/addons/mod/feedback/pages/index/index.html | 2 +- .../components/index/addon-mod-folder-index.html | 5 +++-- src/addons/mod/folder/components/index/index.ts | 4 ++-- src/addons/mod/folder/pages/index/index.html | 2 +- src/addons/mod/forum/components/index/index.html | 6 +++--- .../components/index/addon-mod-glossary-index.html | 6 +++--- src/addons/mod/glossary/components/index/index.ts | 4 ++-- .../components/index/addon-mod-h5pactivity-index.html | 5 +++-- src/addons/mod/h5pactivity/pages/index/index.html | 2 +- .../imscp/components/index/addon-mod-imscp-index.html | 9 +++++---- .../components/index/addon-mod-lesson-index.html | 7 ++++--- src/addons/mod/lesson/components/index/index.ts | 4 ++-- src/addons/mod/lesson/pages/index/index.html | 2 +- .../mod/lti/components/index/addon-mod-lti-index.html | 5 +++-- src/addons/mod/lti/pages/index/index.html | 2 +- .../page/components/index/addon-mod-page-index.html | 5 +++-- src/addons/mod/page/pages/index/index.html | 2 +- .../quiz/components/index/addon-mod-quiz-index.html | 5 +++-- src/addons/mod/quiz/components/index/index.ts | 7 +++---- src/addons/mod/quiz/pages/index/index.html | 2 +- .../components/index/addon-mod-resource-index.html | 5 +++-- src/addons/mod/resource/pages/index/index.html | 2 +- .../scorm/components/index/addon-mod-scorm-index.html | 7 ++++--- src/addons/mod/scorm/pages/index/index.html | 2 +- .../components/index/addon-mod-survey-index.html | 5 +++-- src/addons/mod/survey/pages/index/index.html | 2 +- .../mod/url/components/index/addon-mod-url-index.html | 5 +++-- src/addons/mod/url/pages/index/index.html | 2 +- .../wiki/components/index/addon-mod-wiki-index.html | 7 ++++--- src/addons/mod/wiki/pages/index/index.html | 2 +- .../components/index/addon-mod-workshop-index.html | 5 +++-- src/addons/mod/workshop/pages/index/index.html | 2 +- .../features/course/classes/main-activity-component.ts | 6 +++--- .../features/course/classes/main-resource-component.ts | 10 +++++----- upgrade.txt | 1 + 51 files changed, 118 insertions(+), 98 deletions(-) diff --git a/src/addons/mod/assign/components/index/addon-mod-assign-index.html b/src/addons/mod/assign/components/index/addon-mod-assign-index.html index 44fce0030..72d05bb18 100644 --- a/src/addons/mod/assign/components/index/addon-mod-assign-index.html +++ b/src/addons/mod/assign/components/index/addon-mod-assign-index.html @@ -6,7 +6,7 @@ - + - - + diff --git a/src/addons/mod/assign/pages/index/index.html b/src/addons/mod/assign/pages/index/index.html index 0d424c637..71f69b398 100644 --- a/src/addons/mod/assign/pages/index/index.html +++ b/src/addons/mod/assign/pages/index/index.html @@ -16,7 +16,7 @@ - + diff --git a/src/addons/mod/bigbluebuttonbn/components/index/index.html b/src/addons/mod/bigbluebuttonbn/components/index/index.html index 49ebe332d..98a773c09 100644 --- a/src/addons/mod/bigbluebuttonbn/components/index/index.html +++ b/src/addons/mod/bigbluebuttonbn/components/index/index.html @@ -6,7 +6,7 @@ - + - + diff --git a/src/addons/mod/bigbluebuttonbn/components/index/index.ts b/src/addons/mod/bigbluebuttonbn/components/index/index.ts index 8d85abf94..5f1e648cb 100644 --- a/src/addons/mod/bigbluebuttonbn/components/index/index.ts +++ b/src/addons/mod/bigbluebuttonbn/components/index/index.ts @@ -115,14 +115,14 @@ export class AddonModBBBIndexComponent extends CoreCourseModuleMainActivityCompo return; } - this.loaded = false; + this.showLoading = true; try { await AddonModBBB.invalidateAllGroupsMeetingInfo(this.bbb.id); await this.fetchMeetingInfo(); } finally { - this.loaded = true; + this.showLoading = false; } } @@ -148,14 +148,14 @@ export class AddonModBBBIndexComponent extends CoreCourseModuleMainActivityCompo * @return Promise resolved when done. */ async groupChanged(): Promise { - this.loaded = false; + this.showLoading = true; try { await this.fetchMeetingInfo(); } catch (error) { CoreDomUtils.showErrorModal(error); } finally { - this.loaded = true; + this.showLoading = false; } } diff --git a/src/addons/mod/bigbluebuttonbn/pages/index/index.html b/src/addons/mod/bigbluebuttonbn/pages/index/index.html index 5d8e5197e..f6e0e524e 100644 --- a/src/addons/mod/bigbluebuttonbn/pages/index/index.html +++ b/src/addons/mod/bigbluebuttonbn/pages/index/index.html @@ -15,7 +15,7 @@ - + diff --git a/src/addons/mod/book/components/index/addon-mod-book-index.html b/src/addons/mod/book/components/index/addon-mod-book-index.html index f8d3545b6..410dd43cc 100644 --- a/src/addons/mod/book/components/index/addon-mod-book-index.html +++ b/src/addons/mod/book/components/index/addon-mod-book-index.html @@ -6,7 +6,7 @@ - + - + diff --git a/src/addons/mod/book/pages/index/index.html b/src/addons/mod/book/pages/index/index.html index b09bfab96..fb3db333b 100644 --- a/src/addons/mod/book/pages/index/index.html +++ b/src/addons/mod/book/pages/index/index.html @@ -15,7 +15,7 @@ - + diff --git a/src/addons/mod/chat/components/index/addon-mod-chat-index.html b/src/addons/mod/chat/components/index/addon-mod-chat-index.html index 47f13bd8c..7296cddb5 100644 --- a/src/addons/mod/chat/components/index/addon-mod-chat-index.html +++ b/src/addons/mod/chat/components/index/addon-mod-chat-index.html @@ -6,7 +6,7 @@ - + - + diff --git a/src/addons/mod/chat/pages/index/index.html b/src/addons/mod/chat/pages/index/index.html index ed096fe29..bc5f254eb 100644 --- a/src/addons/mod/chat/pages/index/index.html +++ b/src/addons/mod/chat/pages/index/index.html @@ -15,7 +15,7 @@ - + diff --git a/src/addons/mod/choice/components/index/addon-mod-choice-index.html b/src/addons/mod/choice/components/index/addon-mod-choice-index.html index e29970de6..1eebfa01c 100644 --- a/src/addons/mod/choice/components/index/addon-mod-choice-index.html +++ b/src/addons/mod/choice/components/index/addon-mod-choice-index.html @@ -6,7 +6,7 @@ - + - + diff --git a/src/addons/mod/choice/pages/index/index.html b/src/addons/mod/choice/pages/index/index.html index 7c56322d2..b5a04c2a6 100644 --- a/src/addons/mod/choice/pages/index/index.html +++ b/src/addons/mod/choice/pages/index/index.html @@ -15,7 +15,7 @@ - + diff --git a/src/addons/mod/data/components/index/addon-mod-data-index.html b/src/addons/mod/data/components/index/addon-mod-data-index.html index 59f79533d..bb10fd6d3 100644 --- a/src/addons/mod/data/components/index/addon-mod-data-index.html +++ b/src/addons/mod/data/components/index/addon-mod-data-index.html @@ -18,7 +18,7 @@ - + - + diff --git a/src/addons/mod/data/components/index/index.ts b/src/addons/mod/data/components/index/index.ts index 9bdb523fe..2c367fa48 100644 --- a/src/addons/mod/data/components/index/index.ts +++ b/src/addons/mod/data/components/index/index.ts @@ -133,7 +133,7 @@ export class AddonModDataIndexComponent extends CoreCourseModuleMainActivityComp // Refresh entries on change. this.entryChangedObserver = CoreEvents.on(AddonModDataProvider.ENTRY_CHANGED, (eventData) => { if (this.database?.id == eventData.dataId) { - this.loaded = false; + this.showLoading = true; return this.loadContent(true); } @@ -191,7 +191,7 @@ export class AddonModDataIndexComponent extends CoreCourseModuleMainActivityComp */ protected isRefreshSyncNeeded(syncEventData: AddonModDataAutoSyncData): boolean { if (this.database && syncEventData.dataId == this.database.id && syncEventData.entryId === undefined) { - this.loaded = false; + this.showLoading = true; // Refresh the data. this.content?.scrollToTop(); @@ -404,7 +404,7 @@ export class AddonModDataIndexComponent extends CoreCourseModuleMainActivityComp * @return Resolved when done. */ async searchEntries(page: number): Promise { - this.loaded = false; + this.showLoading = true; this.search.page = page; try { @@ -414,7 +414,7 @@ export class AddonModDataIndexComponent extends CoreCourseModuleMainActivityComp } catch (error) { CoreDomUtils.showErrorModalDefault(error, 'core.course.errorgetmodule', true); } finally { - this.loaded = true; + this.showLoading = false; } } diff --git a/src/addons/mod/data/pages/index/index.html b/src/addons/mod/data/pages/index/index.html index 46e4a1dd9..ff9ed701e 100644 --- a/src/addons/mod/data/pages/index/index.html +++ b/src/addons/mod/data/pages/index/index.html @@ -16,7 +16,7 @@ - + diff --git a/src/addons/mod/feedback/components/index/addon-mod-feedback-index.html b/src/addons/mod/feedback/components/index/addon-mod-feedback-index.html index f564311d8..1da7a6b31 100644 --- a/src/addons/mod/feedback/components/index/addon-mod-feedback-index.html +++ b/src/addons/mod/feedback/components/index/addon-mod-feedback-index.html @@ -6,7 +6,7 @@ - + - + diff --git a/src/addons/mod/feedback/components/index/index.ts b/src/addons/mod/feedback/components/index/index.ts index 255b0e6ce..e31b5f529 100644 --- a/src/addons/mod/feedback/components/index/index.ts +++ b/src/addons/mod/feedback/components/index/index.ts @@ -97,7 +97,7 @@ export class AddonModFeedbackIndexComponent extends CoreCourseModuleMainActivity this.tabsLoaded.analysis = false; this.tabsLoaded.overview = false; - this.loaded = false; + this.showLoading = true; // Prefetch data if needed. if (!data.offline && this.isPrefetched()) { diff --git a/src/addons/mod/feedback/pages/index/index.html b/src/addons/mod/feedback/pages/index/index.html index fa031ccc7..6996000e4 100644 --- a/src/addons/mod/feedback/pages/index/index.html +++ b/src/addons/mod/feedback/pages/index/index.html @@ -15,7 +15,7 @@ - + diff --git a/src/addons/mod/folder/components/index/addon-mod-folder-index.html b/src/addons/mod/folder/components/index/addon-mod-folder-index.html index b01b72741..82cb66284 100644 --- a/src/addons/mod/folder/components/index/addon-mod-folder-index.html +++ b/src/addons/mod/folder/components/index/addon-mod-folder-index.html @@ -6,7 +6,7 @@ - + - + diff --git a/src/addons/mod/folder/components/index/index.ts b/src/addons/mod/folder/components/index/index.ts index 562a2824e..fcfa675c7 100644 --- a/src/addons/mod/folder/components/index/index.ts +++ b/src/addons/mod/folder/components/index/index.ts @@ -55,7 +55,7 @@ export class AddonModFolderIndexComponent extends CoreCourseModuleMainResourceCo this.description = this.folderInstance ? this.folderInstance.intro : this.module.description; this.contents = this.subfolder; - this.loaded = true; + this.showLoading = false; return; } @@ -70,7 +70,7 @@ export class AddonModFolderIndexComponent extends CoreCourseModuleMainResourceCo // Ignore errors. } } finally { - this.loaded = true; + this.showLoading = false; } } diff --git a/src/addons/mod/folder/pages/index/index.html b/src/addons/mod/folder/pages/index/index.html index 442b976ec..b83a186f5 100644 --- a/src/addons/mod/folder/pages/index/index.html +++ b/src/addons/mod/folder/pages/index/index.html @@ -16,7 +16,7 @@ - diff --git a/src/addons/mod/forum/components/index/index.html b/src/addons/mod/forum/components/index/index.html index a7a5afbdc..1c8e9e08a 100644 --- a/src/addons/mod/forum/components/index/index.html +++ b/src/addons/mod/forum/components/index/index.html @@ -7,11 +7,11 @@ - + - + @@ -114,7 +114,7 @@ - diff --git a/src/addons/mod/glossary/components/index/addon-mod-glossary-index.html b/src/addons/mod/glossary/components/index/addon-mod-glossary-index.html index 524abb9b1..c973a95a3 100644 --- a/src/addons/mod/glossary/components/index/addon-mod-glossary-index.html +++ b/src/addons/mod/glossary/components/index/addon-mod-glossary-index.html @@ -16,7 +16,7 @@ - + @@ -24,7 +24,7 @@ [autoFocus]="true" [lengthCheck]="2" (onClear)="toggleSearch()" searchArea="AddonModGlossary-{{module.id}}"> - + @@ -72,7 +72,7 @@ - diff --git a/src/addons/mod/glossary/components/index/index.ts b/src/addons/mod/glossary/components/index/index.ts index cbcc5aa89..4e483a919 100644 --- a/src/addons/mod/glossary/components/index/index.ts +++ b/src/addons/mod/glossary/components/index/index.ts @@ -393,7 +393,7 @@ export class AddonModGlossaryIndexComponent extends CoreCourseModuleMainActivity this.loadingMessage = Translate.instant('core.loading'); this.content?.scrollToTop(); this.switchMode(mode); - this.loaded = false; + this.showLoading = true; this.loadContent(); } @@ -411,7 +411,7 @@ export class AddonModGlossaryIndexComponent extends CoreCourseModuleMainActivity */ search(query: string): void { this.loadingMessage = Translate.instant('core.searching'); - this.loaded = false; + this.showLoading = true; this.entries?.getSource().search(query); this.loadContent(); diff --git a/src/addons/mod/h5pactivity/components/index/addon-mod-h5pactivity-index.html b/src/addons/mod/h5pactivity/components/index/addon-mod-h5pactivity-index.html index 039f30ce2..deed6960a 100644 --- a/src/addons/mod/h5pactivity/components/index/addon-mod-h5pactivity-index.html +++ b/src/addons/mod/h5pactivity/components/index/addon-mod-h5pactivity-index.html @@ -16,7 +16,7 @@ - + - + diff --git a/src/addons/mod/h5pactivity/pages/index/index.html b/src/addons/mod/h5pactivity/pages/index/index.html index 6ac751048..8c2890fee 100644 --- a/src/addons/mod/h5pactivity/pages/index/index.html +++ b/src/addons/mod/h5pactivity/pages/index/index.html @@ -16,7 +16,7 @@ - + diff --git a/src/addons/mod/imscp/components/index/addon-mod-imscp-index.html b/src/addons/mod/imscp/components/index/addon-mod-imscp-index.html index d795fb3fe..a3ce89920 100644 --- a/src/addons/mod/imscp/components/index/addon-mod-imscp-index.html +++ b/src/addons/mod/imscp/components/index/addon-mod-imscp-index.html @@ -1,6 +1,6 @@ - + @@ -10,7 +10,7 @@ - + @@ -26,9 +26,10 @@
- +
- + diff --git a/src/addons/mod/lesson/components/index/addon-mod-lesson-index.html b/src/addons/mod/lesson/components/index/addon-mod-lesson-index.html index cb63e1d65..b183a984a 100644 --- a/src/addons/mod/lesson/components/index/addon-mod-lesson-index.html +++ b/src/addons/mod/lesson/components/index/addon-mod-lesson-index.html @@ -6,8 +6,8 @@ - - + + @@ -278,5 +278,6 @@ - + diff --git a/src/addons/mod/lesson/components/index/index.ts b/src/addons/mod/lesson/components/index/index.ts index 1a9e8b614..415bf0555 100644 --- a/src/addons/mod/lesson/components/index/index.ts +++ b/src/addons/mod/lesson/components/index/index.ts @@ -618,7 +618,7 @@ export class AddonModLessonIndexComponent extends CoreCourseModuleMainActivityCo return; } - this.loaded = false; + this.showLoading = true; try { await this.validatePassword( password); @@ -635,7 +635,7 @@ export class AddonModLessonIndexComponent extends CoreCourseModuleMainActivityCo } catch (error) { CoreDomUtils.showErrorModal(error); } finally { - this.loaded = true; + this.showLoading = false; CoreForms.triggerFormSubmittedEvent(this.formElement, true, this.siteId); } diff --git a/src/addons/mod/lesson/pages/index/index.html b/src/addons/mod/lesson/pages/index/index.html index a6b75a913..fec01e323 100644 --- a/src/addons/mod/lesson/pages/index/index.html +++ b/src/addons/mod/lesson/pages/index/index.html @@ -15,7 +15,7 @@ - + diff --git a/src/addons/mod/lti/components/index/addon-mod-lti-index.html b/src/addons/mod/lti/components/index/addon-mod-lti-index.html index dc3b6068d..1452e0c18 100644 --- a/src/addons/mod/lti/components/index/addon-mod-lti-index.html +++ b/src/addons/mod/lti/components/index/addon-mod-lti-index.html @@ -6,7 +6,7 @@ - + - + diff --git a/src/addons/mod/lti/pages/index/index.html b/src/addons/mod/lti/pages/index/index.html index 9b7017a3f..38ce5fc89 100644 --- a/src/addons/mod/lti/pages/index/index.html +++ b/src/addons/mod/lti/pages/index/index.html @@ -16,7 +16,7 @@ - + diff --git a/src/addons/mod/page/components/index/addon-mod-page-index.html b/src/addons/mod/page/components/index/addon-mod-page-index.html index 1cfc5f303..83536200d 100644 --- a/src/addons/mod/page/components/index/addon-mod-page-index.html +++ b/src/addons/mod/page/components/index/addon-mod-page-index.html @@ -6,7 +6,7 @@ - + - + diff --git a/src/addons/mod/page/pages/index/index.html b/src/addons/mod/page/pages/index/index.html index cab819bed..fc6dc2f86 100644 --- a/src/addons/mod/page/pages/index/index.html +++ b/src/addons/mod/page/pages/index/index.html @@ -15,7 +15,7 @@ - + diff --git a/src/addons/mod/quiz/components/index/addon-mod-quiz-index.html b/src/addons/mod/quiz/components/index/addon-mod-quiz-index.html index 6323f3cb5..59961b31c 100644 --- a/src/addons/mod/quiz/components/index/addon-mod-quiz-index.html +++ b/src/addons/mod/quiz/components/index/addon-mod-quiz-index.html @@ -6,7 +6,7 @@ - + - + diff --git a/src/addons/mod/quiz/components/index/index.ts b/src/addons/mod/quiz/components/index/index.ts index 1f03d876e..d827022de 100644 --- a/src/addons/mod/quiz/components/index/index.ts +++ b/src/addons/mod/quiz/components/index/index.ts @@ -455,13 +455,13 @@ export class AddonModQuizIndexComponent extends CoreCourseModuleMainActivityComp } // Refresh data. - this.loaded = false; + this.showLoading = true; this.content?.scrollToTop(); await promise; await CoreUtils.ignoreErrors(this.refreshContent(true)); - this.loaded = true; + this.showLoading = false; } /** @@ -547,8 +547,7 @@ export class AddonModQuizIndexComponent extends CoreCourseModuleMainActivityComp if (status == CoreConstants.DOWNLOADED && previousStatus == CoreConstants.DOWNLOADING) { // Quiz downloaded now, maybe a new attempt was created. Load content again. - this.loaded = false; - this.loadContent(); + this.showLoadingAndFetch(); } } diff --git a/src/addons/mod/quiz/pages/index/index.html b/src/addons/mod/quiz/pages/index/index.html index 9a58a95ff..233973f4f 100644 --- a/src/addons/mod/quiz/pages/index/index.html +++ b/src/addons/mod/quiz/pages/index/index.html @@ -16,7 +16,7 @@ - + diff --git a/src/addons/mod/resource/components/index/addon-mod-resource-index.html b/src/addons/mod/resource/components/index/addon-mod-resource-index.html index 89fbf28f7..1efbca3f9 100644 --- a/src/addons/mod/resource/components/index/addon-mod-resource-index.html +++ b/src/addons/mod/resource/components/index/addon-mod-resource-index.html @@ -6,7 +6,7 @@ - + - + diff --git a/src/addons/mod/resource/pages/index/index.html b/src/addons/mod/resource/pages/index/index.html index ac1c3727e..4bfe3e2a6 100644 --- a/src/addons/mod/resource/pages/index/index.html +++ b/src/addons/mod/resource/pages/index/index.html @@ -16,7 +16,7 @@ - diff --git a/src/addons/mod/scorm/components/index/addon-mod-scorm-index.html b/src/addons/mod/scorm/components/index/addon-mod-scorm-index.html index 275c81125..96329ba19 100644 --- a/src/addons/mod/scorm/components/index/addon-mod-scorm-index.html +++ b/src/addons/mod/scorm/components/index/addon-mod-scorm-index.html @@ -6,7 +6,7 @@ - + - + @@ -217,5 +217,6 @@ - + diff --git a/src/addons/mod/scorm/pages/index/index.html b/src/addons/mod/scorm/pages/index/index.html index fc1e6f57f..00e1aa739 100644 --- a/src/addons/mod/scorm/pages/index/index.html +++ b/src/addons/mod/scorm/pages/index/index.html @@ -15,7 +15,7 @@ - + diff --git a/src/addons/mod/survey/components/index/addon-mod-survey-index.html b/src/addons/mod/survey/components/index/addon-mod-survey-index.html index acafdf331..8c99699fc 100644 --- a/src/addons/mod/survey/components/index/addon-mod-survey-index.html +++ b/src/addons/mod/survey/components/index/addon-mod-survey-index.html @@ -6,7 +6,7 @@ - + - + diff --git a/src/addons/mod/survey/pages/index/index.html b/src/addons/mod/survey/pages/index/index.html index 808d88eb1..02673c75d 100644 --- a/src/addons/mod/survey/pages/index/index.html +++ b/src/addons/mod/survey/pages/index/index.html @@ -15,7 +15,7 @@ - + diff --git a/src/addons/mod/url/components/index/addon-mod-url-index.html b/src/addons/mod/url/components/index/addon-mod-url-index.html index ccf09a1a2..0153bcdf7 100644 --- a/src/addons/mod/url/components/index/addon-mod-url-index.html +++ b/src/addons/mod/url/components/index/addon-mod-url-index.html @@ -6,7 +6,7 @@ - + - + diff --git a/src/addons/mod/url/pages/index/index.html b/src/addons/mod/url/pages/index/index.html index 45dc4198c..f940549ef 100644 --- a/src/addons/mod/url/pages/index/index.html +++ b/src/addons/mod/url/pages/index/index.html @@ -15,7 +15,7 @@ - + diff --git a/src/addons/mod/wiki/components/index/addon-mod-wiki-index.html b/src/addons/mod/wiki/components/index/addon-mod-wiki-index.html index 462d5a1b4..342e83895 100644 --- a/src/addons/mod/wiki/components/index/addon-mod-wiki-index.html +++ b/src/addons/mod/wiki/components/index/addon-mod-wiki-index.html @@ -7,7 +7,7 @@ - @@ -27,7 +27,7 @@ - + - + diff --git a/src/addons/mod/wiki/pages/index/index.html b/src/addons/mod/wiki/pages/index/index.html index a33c7c251..0c013169c 100644 --- a/src/addons/mod/wiki/pages/index/index.html +++ b/src/addons/mod/wiki/pages/index/index.html @@ -16,7 +16,7 @@ - + diff --git a/src/addons/mod/workshop/components/index/addon-mod-workshop-index.html b/src/addons/mod/workshop/components/index/addon-mod-workshop-index.html index f24b28232..02761fc74 100644 --- a/src/addons/mod/workshop/components/index/addon-mod-workshop-index.html +++ b/src/addons/mod/workshop/components/index/addon-mod-workshop-index.html @@ -6,7 +6,7 @@ - + @@ -233,5 +233,6 @@ - + diff --git a/src/addons/mod/workshop/pages/index/index.html b/src/addons/mod/workshop/pages/index/index.html index 9b639898c..c9fdc573a 100644 --- a/src/addons/mod/workshop/pages/index/index.html +++ b/src/addons/mod/workshop/pages/index/index.html @@ -15,7 +15,7 @@ - + diff --git a/src/core/features/course/classes/main-activity-component.ts b/src/core/features/course/classes/main-activity-component.ts index d0214e996..e41b66bfb 100644 --- a/src/core/features/course/classes/main-activity-component.ts +++ b/src/core/features/course/classes/main-activity-component.ts @@ -116,7 +116,7 @@ export class CoreCourseModuleMainActivityComponent extends CoreCourseModuleMainR * @return Resolved when done. */ protected async showLoadingAndFetch(sync: boolean = false, showErrors: boolean = false): Promise { - this.loaded = false; + this.showLoading = true; this.content?.scrollToTop(); await this.loadContent(false, sync, showErrors); @@ -130,7 +130,7 @@ export class CoreCourseModuleMainActivityComponent extends CoreCourseModuleMainR * @return Resolved when done. */ protected showLoadingAndRefresh(sync: boolean = false, showErrors: boolean = false): Promise { - this.loaded = false; + this.showLoading = true; this.content?.scrollToTop(); return this.refreshContent(sync, showErrors); @@ -177,7 +177,7 @@ export class CoreCourseModuleMainActivityComponent extends CoreCourseModuleMainR CoreDomUtils.showErrorModalDefault(error, this.fetchContentDefaultError, true); } finally { - this.loaded = true; + this.showLoading = false; } } diff --git a/src/core/features/course/classes/main-resource-component.ts b/src/core/features/course/classes/main-resource-component.ts index 6536145e0..2a0eed662 100644 --- a/src/core/features/course/classes/main-resource-component.ts +++ b/src/core/features/course/classes/main-resource-component.ts @@ -52,7 +52,7 @@ export class CoreCourseModuleMainResourceComponent implements OnInit, OnDestroy, @Input() courseId!: number; // Course ID the component belongs to. @Output() dataRetrieved = new EventEmitter(); // Called to notify changes the index page from the main component. - loaded = false; // If the component has been loaded. + showLoading = true; // Whether to show loading. component?: string; // Component name. componentId?: number; // Component ID. hasOffline = false; // Resources don't have any data to sync. @@ -199,7 +199,7 @@ export class CoreCourseModuleMainResourceComponent implements OnInit, OnDestroy, CoreDomUtils.showErrorModalDefault(error, this.fetchContentDefaultError, true); } finally { - this.loaded = true; + this.showLoading = false; } } @@ -416,12 +416,12 @@ export class CoreCourseModuleMainResourceComponent implements OnInit, OnDestroy, }); if (data) { - if (this.loaded && (data.action == 'refresh' || data.action == 'sync')) { - this.loaded = false; + if (!this.showLoading && (data.action == 'refresh' || data.action == 'sync')) { + this.showLoading = true; try { await this.doRefresh(undefined, data.action == 'sync'); } finally { - this.loaded = true; + this.showLoading = false; } } } diff --git a/upgrade.txt b/upgrade.txt index ebb311bcb..e01fe0058 100644 --- a/upgrade.txt +++ b/upgrade.txt @@ -22,6 +22,7 @@ information provided here is intended especially for developers. - The parameters of the following functions in CoreCourseHelper have changed: navigateToModuleByInstance, navigateToModule, openModule. - fillContextMenu, expandDescription, gotoBlog, prefetch and removeFiles functions have been removed from CoreCourseModuleMainResourceComponent. - contextMenuPrefetch and fillContextMenu have been removed from CoreCourseHelper. +-The variable "loaded" in CoreCourseModuleMainResourceComponent has been changed to "showLoading" to reflect its purpose better.