Merge pull request #3624 from dpalou/MOBILE-3535

MOBILE-3535 lesson: Fix undefined attempt if load fails
main
Pau Ferrer Ocaña 2023-04-20 10:55:58 +02:00 committed by GitHub
commit 3782ee43c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -94,7 +94,7 @@ export class AddonModLessonUserRetakePage implements OnInit {
try { try {
await this.setRetake(retakeNumber); await this.setRetake(retakeNumber);
} catch (error) { } catch (error) {
this.selectedRetake = this.previousSelectedRetake; this.selectedRetake = this.previousSelectedRetake ?? this.selectedRetake;
CoreDomUtils.showErrorModal(CoreUtils.addDataNotDownloadedError(error, 'Error getting attempt.')); CoreDomUtils.showErrorModal(CoreUtils.addDataNotDownloadedError(error, 'Error getting attempt.'));
} finally { } finally {
this.loaded = true; this.loaded = true;