MOBILE-3136 calendar: Fix param pass to day view

main
Pau Ferrer Ocaña 2019-11-21 16:05:19 +01:00
parent 64bfc0f264
commit 43c484a302
2 changed files with 9 additions and 5 deletions

View File

@ -108,9 +108,13 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy {
const now = new Date();
AddonCalendarProvider.ALL_TYPES.forEach((name) => {
this.filter[name] = true;
this.filter[name] = navParams.get(name);
this.filter[name] = typeof this.filter[name] == 'undefined' ? true : this.filter[name];
});
this.filter['courseId'] = navParams.get('courseId');
this.filter.courseId = navParams.get('courseId');
this.filter.categoryId = navParams.get('categoryId');
this.filter.filtered = this.filter.courseId || AddonCalendarProvider.ALL_TYPES.some((name) => !this.filter[name]);
this.year = navParams.get('year') || now.getFullYear();
this.month = navParams.get('month') || (now.getMonth() + 1);

View File

@ -324,9 +324,9 @@ export class AddonCalendarIndexPage implements OnInit, OnDestroy {
year: data.year
};
if (this.filter.courseId) {
params.courseId = this.filter.courseId;
}
Object.keys(this.filter).forEach((key) => {
params[key] = this.filter[key];
});
this.navCtrl.push('AddonCalendarDayPage', params);
}