mirror of
https://gitlab.com/walljm/dynamicbible.git
synced 2025-07-25 00:09:54 -04:00
PERF: implemented OnInit on search page to speed up load
This commit is contained in:
parent
755aa28c3b
commit
632ee22189
@ -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()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user