diff --git a/REMEMBER.txt b/REMEMBER.txt index 6067556..a74eb61 100644 --- a/REMEMBER.txt +++ b/REMEMBER.txt @@ -70,6 +70,9 @@ ionic generate interface interfaces/location ionic generate interface interfaces/marker +ionic generate service interval-refresh +ionic generate service family-data +ionic generate service market-data $ ionic generate diff --git a/src/app/pages/home/home.page.ts b/src/app/pages/home/home.page.ts index 0196415..182c92f 100644 --- a/src/app/pages/home/home.page.ts +++ b/src/app/pages/home/home.page.ts @@ -6,6 +6,7 @@ import { WrenchService } from 'src/app/services/wrench.service'; import { OnesignalService } from 'src/app/services/onesignal.service';// import { UserWalletService } from 'src/app/store/user-wallet.service'; import { LocTrcService } from "../../services/loc-trc.service"; +import {MarketDataService} from "../../store/market-data.service"; //import * as stream from "stream"; @@ -34,7 +35,8 @@ export class HomePage implements OnInit { private onesignalService: OnesignalService, public blogDataService: BlogDataService, public userWalletService: UserWalletService, - private locTrcService:LocTrcService + private locTrcService:LocTrcService, + public marketDataService:MarketDataService, ) { this.accountType = sessionDataProviderService.account_type; this.firstname = this.sessionDataProviderService.firstname; @@ -73,7 +75,7 @@ export class HomePage implements OnInit { console.log('Home page did enter - > ionViewWillEnter'); this.allInitFunctions(); } - walletPresentation(){ + async walletPresentation(){ this.walletData = this.userWalletService.getWallet(); if( this.walletData?.length > 0 ) { var num = new Number(this.walletData[0].amount*0.01); diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 43018c7..2256afa 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -4,7 +4,7 @@ import { WrenchService } from 'src/app/services/wrench.service'; import { SessionDataProviderService } from 'src/app/store/session-data-provider.service'; import { BlogDataService } from 'src/app/store/blog-data.service'; import { environment} from "../../../environments/environment"; -import { AlertController, Platform } from '@ionic/angular'; +import {AlertController, LoadingController, Platform} from '@ionic/angular'; import { Preferences } from '@capacitor/preferences'; import { Capacitor } from '@capacitor/core'; import jwt_decode from "jwt-decode"; @@ -18,6 +18,9 @@ import { FacebookLoginResponse, } from '@capacitor-community/facebook-login'; import { GoogleAuth, User } from '@codetrix-studio/capacitor-google-auth'; +import {UserWalletService} from "../../store/user-wallet.service"; +import {IntervalRefreshService} from "../../store/interval-refresh.service"; +import {MarketDataService} from "../../store/market-data.service"; @Component({ selector: 'app-login', @@ -53,8 +56,13 @@ export class LoginPage implements OnInit { public sessionDataProviderService:SessionDataProviderService, public blogDataService:BlogDataService, private alertController: AlertController, - public platform: Platform - ) { + public userWalletService: UserWalletService, + public intervalRefreshService: IntervalRefreshService, + public platform: Platform, + private loadingCtrl: LoadingController, + public marketDataService:MarketDataService, + ) { + this.sessionDataProviderService.DestroySessionOnLogout(); // https://ionicframework.com/docs/angular/platform this.ios = platform.is('ios'); this.android = platform.is('android'); @@ -111,11 +119,17 @@ getBlogData(){ loginData: { username: string, password: string, sessionid: string }; - startLogin() { + async startLogin() { + const loading = await this.loadingCtrl.create({ + message: 'Starting ... ', + duration: 1500, + }); + if (this.username == null || this.username == '' || this.validateEmail(this.username) == false || this.password == null || this.password == '') { this.showAlert('Invalid Login', 'Enter username(email) and password to login'); return; } + loading.present(); this.loginData = { username: this.username, password: this.password, sessionid: 'DUMMY-APP-SESSION' } this.wrenchService.loginUser(this.loginData).subscribe( loginResult => { @@ -131,8 +145,12 @@ getBlogData(){ }; - this.getBlogData(); - this.router.navigate(['tabs/tab1']); + // this.intervalRefreshService.startIntervalCalls(); // anything with interval call + // this.marketDataService.getJobsData(); + // this.getBlogData(); + // this.userWalletService.getWallet(); + this.startUpCalls(); + this.router.navigate(['tabs/tab1']); } else{ //debugger; @@ -151,6 +169,12 @@ getBlogData(){ ); } + async startUpCalls(){ + this.intervalRefreshService.startIntervalCalls(); // anything with interval call + this.marketDataService.getJobsData(); + this.getBlogData(); + this.userWalletService.getWalletData(); + } onForgot() { this.router.navigate(['forgot']); } @@ -254,8 +278,12 @@ getBlogData(){ value: this.username, }); }; - - this.getBlogData(); + + // this.intervalRefreshService.startIntervalCalls(); // anything with interval call + // this.marketDataService.getJobsData(); + // this.getBlogData(); + // this.userWalletService.getWallet(); + this.startUpCalls(); this.router.navigate(['tabs/tab1']); } else{ @@ -324,8 +352,12 @@ getBlogData(){ value: this.username, }); }; - - this.getBlogData(); + + // this.intervalRefreshService.startIntervalCalls(); // anything with interval call + // this.marketDataService.getJobsData(); + // this.getBlogData(); + // this.userWalletService.getWallet(); + this.startUpCalls(); this.router.navigate(['tabs/tab1']); } else{ @@ -458,9 +490,12 @@ getBlogData(){ value: this.username, }); }; - - - this.getBlogData(); + + // this.intervalRefreshService.startIntervalCalls(); // anything with interval call + // this.marketDataService.getJobsData(); + // this.getBlogData(); + // this.userWalletService.getWallet(); + this.startUpCalls(); this.router.navigate(['tabs/tab1']); } else{ diff --git a/src/app/pages/my-course/my-course.page.html b/src/app/pages/my-course/my-course.page.html index 908e75d..024030b 100644 --- a/src/app/pages/my-course/my-course.page.html +++ b/src/app/pages/my-course/my-course.page.html @@ -30,7 +30,7 @@