MOBILE-3320 calendar: Fix iOS app crash in settings

main
Dani Palou 2021-05-12 16:20:52 +02:00
parent f9fc2d3758
commit f5098a770c
4 changed files with 14 additions and 15 deletions

View File

@ -92,7 +92,7 @@
</ion-label> </ion-label>
<ion-select formControlName="groupcourseid" aria-labelledby="addon-calendar-groupcourse-label" <ion-select formControlName="groupcourseid" aria-labelledby="addon-calendar-groupcourse-label"
interface="action-sheet" [placeholder]="'core.noselection' | translate" interface="action-sheet" [placeholder]="'core.noselection' | translate"
(ionChange)="groupCourseSelected($event)"> (ionChange)="groupCourseSelected()">
<ion-select-option *ngFor="let course of courses" [value]="course.id"> <ion-select-option *ngFor="let course of courses" [value]="course.id">
{{ course.fullname }} {{ course.fullname }}
</ion-select-option> </ion-select-option>

View File

@ -396,10 +396,9 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave {
/** /**
* A course was selected, get its groups. * A course was selected, get its groups.
*
* @param courseId Course ID.
*/ */
async groupCourseSelected(courseId: number): Promise<void> { async groupCourseSelected(): Promise<void> {
const courseId = this.form.controls.groupcourseid.value;
if (!courseId) { if (!courseId) {
return; return;
} }

View File

@ -8,17 +8,17 @@
</ion-header> </ion-header>
<ion-content> <ion-content>
<ion-list> <ion-list>
<ion-item> <ion-item *ngIf="defaultTime != -1">
<ion-label>{{ 'addon.calendar.defaultnotificationtime' | translate }}</ion-label> <ion-label>{{ 'addon.calendar.defaultnotificationtime' | translate }}</ion-label>
<ion-select [(ngModel)]="defaultTime" (ionChange)="updateDefaultTime($event)" interface="action-sheet"> <ion-select [(ngModel)]="defaultTime" (ionChange)="updateDefaultTime(defaultTime)" interface="action-sheet">
<ion-select-option value="0">{{ 'core.settings.disabled' | translate }}</ion-select-option> <ion-select-option [value]="0">{{ 'core.settings.disabled' | translate }}</ion-select-option>
<ion-select-option value="10">{{ 600 | coreDuration }}</ion-select-option> <ion-select-option [value]="10">{{ 600 | coreDuration }}</ion-select-option>
<ion-select-option value="30">{{ 1800 | coreDuration }}</ion-select-option> <ion-select-option [value]="30">{{ 1800 | coreDuration }}</ion-select-option>
<ion-select-option value="60">{{ 3600 | coreDuration }}</ion-select-option> <ion-select-option [value]="60">{{ 3600 | coreDuration }}</ion-select-option>
<ion-select-option value="120">{{ 7200 | coreDuration }}</ion-select-option> <ion-select-option [value]="120">{{ 7200 | coreDuration }}</ion-select-option>
<ion-select-option value="360">{{ 21600 | coreDuration }}</ion-select-option> <ion-select-option [value]="360">{{ 21600 | coreDuration }}</ion-select-option>
<ion-select-option value="720">{{ 43200 | coreDuration }}</ion-select-option> <ion-select-option [value]="720">{{ 43200 | coreDuration }}</ion-select-option>
<ion-select-option value="1440">{{ 86400 | coreDuration }}</ion-select-option> <ion-select-option [value]="1440">{{ 86400 | coreDuration }}</ion-select-option>
</ion-select> </ion-select>
</ion-item> </ion-item>
</ion-list> </ion-list>

View File

@ -26,7 +26,7 @@ import { CoreSites } from '@services/sites';
}) })
export class AddonCalendarSettingsPage implements OnInit { export class AddonCalendarSettingsPage implements OnInit {
defaultTime = 0; defaultTime = -1;
/** /**
* View loaded. * View loaded.