diff --git a/DynamicBibleIonic/src/pages/search/search.ts b/DynamicBibleIonic/src/pages/search/search.ts index 5b63a00c..acd2a039 100644 --- a/DynamicBibleIonic/src/pages/search/search.ts +++ b/DynamicBibleIonic/src/pages/search/search.ts @@ -1,4 +1,4 @@ -import { Type, Component } from '@angular/core'; +import { Type, Component, OnInit } from '@angular/core'; import { Loading, LoadingController, ModalController, NavParams, AlertController, MenuController } from 'ionic-angular'; import { Storage } from '@ionic/storage'; @@ -11,7 +11,7 @@ import { Reference } from '../../libs/Reference'; @Component({ templateUrl: 'search.html' }) -export class SearchPage +export class SearchPage implements OnInit { searchQuery = ''; userProfile: UserProfile; @@ -30,7 +30,10 @@ export class SearchPage ) { this.userProfile = new UserProfile(UserProfile.createDefaultUser()); + } + ngOnInit(): void + { // Check if there is a profile saved in local storage this.local.get('profile').then(profile => { @@ -39,14 +42,14 @@ export class SearchPage if (profile !== null) t = JSON.parse(profile); - this.userProfile.update(t, local); + this.userProfile.update(t, this.local); this.initializeItems(this.userProfile); }).catch(error => { console.log(error); - }); - } + }); + } actionsMenu() {