diff --git a/src/addon/block/myoverview/components/myoverview/addon-block-myoverview.html b/src/addon/block/myoverview/components/myoverview/addon-block-myoverview.html
index 598c204f0..294a499c4 100644
--- a/src/addon/block/myoverview/components/myoverview/addon-block-myoverview.html
+++ b/src/addon/block/myoverview/components/myoverview/addon-block-myoverview.html
@@ -19,11 +19,11 @@
{{ 'addon.block_myoverview.all' | translate }}∫
- {{ 'addon.block_myoverview.inprogress' | translate }}
- {{ 'addon.block_myoverview.future' | translate }}
- {{ 'addon.block_myoverview.past' | translate }}
- {{ 'addon.block_myoverview.favourites' | translate }}
- {{ 'addon.block_myoverview.hiddencourses' | translate }}
+ {{ 'addon.block_myoverview.inprogress' | translate }}
+ {{ 'addon.block_myoverview.future' | translate }}
+ {{ 'addon.block_myoverview.past' | translate }}
+ {{ 'addon.block_myoverview.favourites' | translate }}
+ {{ 'addon.block_myoverview.hiddencourses' | translate }}
diff --git a/src/addon/block/myoverview/components/myoverview/myoverview.ts b/src/addon/block/myoverview/components/myoverview/myoverview.ts
index d257764c2..ed68b9205 100644
--- a/src/addon/block/myoverview/components/myoverview/myoverview.ts
+++ b/src/addon/block/myoverview/components/myoverview/myoverview.ts
@@ -64,6 +64,11 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem
showSortFilter = false;
downloadCourseEnabled: boolean;
downloadCoursesEnabled: boolean;
+ disableInProgress = false;
+ disablePast = false;
+ disableFuture = false;
+ disableFavourite = false;
+ disableHidden = false;
protected prefetchIconsInitialized = false;
protected isDestroyed;
@@ -170,12 +175,17 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem
this.courses.filter = '';
this.showFilter = false;
+ this.disableInProgress = this.courses.inprogress.length === 0;
+ this.disablePast = this.courses.past.length === 0;
+ this.disableFuture = this.courses.future.length === 0;
this.showSelectorFilter = courses.length > 0 && (this.courses.past.length > 0 || this.courses.future.length > 0 ||
- typeof courses[0].enddate != 'undefined');
+ typeof courses[0].enddate != 'undefined');
this.showHidden = this.showSelectorFilter && typeof courses[0].hidden != 'undefined';
+ this.disableHidden = this.courses.hidden.length === 0;
this.showFavourite = this.showSelectorFilter && typeof courses[0].isfavourite != 'undefined';
- if (!this.showSelectorFilter) {
- // No selector, show all.
+ this.disableFavourite = this.courses.favourite.length === 0;
+ if (!this.showSelectorFilter || (this.selectedFilter === 'inprogress' && this.disableInProgress)) {
+ // No selector, or the default option is disabled, show all.
this.selectedFilter = 'all';
}
this.filteredCourses = this.courses[this.selectedFilter];