Commit dc69c676 authored by Konstantin Schulz's avatar Konstantin Schulz
Browse files

improved update mechanism for the exercise repository

parent 1c4b753e
Pipeline #11381 passed with stage
in 1 minute and 40 seconds
{
"name": "mc_frontend",
"version": "1.8.1",
"version": "1.8.4",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
......
......@@ -103,15 +103,13 @@ export class ExerciseListPage implements OnInit {
this.helperService.makeGetRequest(this.http, this.toastCtrl, url, params).then((exercises: ExerciseMC[]) => {
updateInfo.exerciseList = new Date().getTime();
this.storage.set(configMC.localStorageKeyUpdateInfo, JSON.stringify(updateInfo)).then();
if (exercises.length) {
state.exerciseList = this.availableExercises = this.exercises = exercises;
this.helperService.saveApplicationState(state).then();
} else {
this.availableExercises = this.exercises = state.exerciseList;
}
state.exerciseList = this.availableExercises = this.exercises = exercises;
this.helperService.saveApplicationState(state).then();
this.processExercises();
return resolve();
}, () => {
this.availableExercises = this.exercises = state.exerciseList;
this.processExercises();
return reject();
});
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment