diff --git a/src/src/providers/lectures-provider.ts b/src/src/providers/lectures-provider.ts index 3b8b9e57158a2b39e5b954eed6d3625921490e08..b462f8470b552dda9654e81e771d190dd222fe4a 100644 --- a/src/src/providers/lectures-provider.ts +++ b/src/src/providers/lectures-provider.ts @@ -33,8 +33,7 @@ export class LecturesProvider { this.lecturesVersion = result.version; this.initial = true; console.log("Lectures loaded from json"); - this.storage.set('lecturesData',JSON.stringify(this.lecturesData)); - this.storage.set('lecturesVersion',this.lecturesVersion); + this.storeData(); this.source = "json" }, err =>{ @@ -53,6 +52,11 @@ export class LecturesProvider { } } + storeData(){ + this.storage.set('lecturesData',JSON.stringify(this.lecturesData)); + this.storage.set('lecturesVersion',this.lecturesVersion); + } + sync(){ this.http.get(this.settings.data.lecturesURL).map(res => res.json()).subscribe( result => { @@ -157,6 +161,7 @@ export class LecturesProvider { }else{ lecture.favourite=true; } + this.storeData(); } }