Skip to content
Snippets Groups Projects
Commit 1c161019 authored by wonko's avatar wonko
Browse files

make favs persistant

parent 67e2df97
No related branches found
No related tags found
No related merge requests found
......@@ -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();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment