| @@ -11,7 +11,7 @@ | |||||
| <section class="social-login" [ngClass]="{'active' : showLogout && user }"> | <section class="social-login" [ngClass]="{'active' : showLogout && user }"> | ||||
| <section class="login-box" *ngIf="user"> | <section class="login-box" *ngIf="user"> | ||||
| <button (click)="logout()"> | <button (click)="logout()"> | ||||
| Logout & Exit from "{{ user.name }}"? | |||||
| Logout & Exit? | |||||
| </button> | </button> | ||||
| <button (click)="showLogout = false"> | <button (click)="showLogout = false"> | ||||
| <ion-icon name="close-circle-outline"></ion-icon> | <ion-icon name="close-circle-outline"></ion-icon> | ||||
| @@ -129,7 +129,6 @@ export class HomePage implements OnInit { | |||||
| ionViewDidEnter() { | ionViewDidEnter() { | ||||
| this.userService.getUserProfile().then((data: any) => { | this.userService.getUserProfile().then((data: any) => { | ||||
| alert(JSON.stringify(data)); | |||||
| this.liked_articles = data.liked_articles; | this.liked_articles = data.liked_articles; | ||||
| this.bookmarked_articles = data.bookmarked_articles; | this.bookmarked_articles = data.bookmarked_articles; | ||||
| }, () => { | }, () => { | ||||
| @@ -1,5 +1,5 @@ | |||||
| import { Component, OnInit } from '@angular/core'; | import { Component, OnInit } from '@angular/core'; | ||||
| import { Router } from '@angular/router'; | |||||
| import { Location } from '@angular/common'; | |||||
| @Component({ | @Component({ | ||||
| selector: 'app-welcome', | selector: 'app-welcome', | ||||
| @@ -10,20 +10,20 @@ export class WelcomePage implements OnInit { | |||||
| user: any; | user: any; | ||||
| constructor( | constructor( | ||||
| private router: Router | |||||
| private location: Location | |||||
| ) { } | ) { } | ||||
| ngOnInit() { | ngOnInit() { | ||||
| if (localStorage.getItem('FBUser')) { | if (localStorage.getItem('FBUser')) { | ||||
| this.user = JSON.parse(localStorage.getItem('FBUser')); | this.user = JSON.parse(localStorage.getItem('FBUser')); | ||||
| setTimeout(() => { | |||||
| this.router.navigate(['/tabs/home']); | |||||
| setTimeout(() => { | |||||
| this.location.back(); | |||||
| }, 3000); | }, 3000); | ||||
| } else { | } else { | ||||
| this.user = null; | this.user = null; | ||||
| this.router.navigate(['/tabs/home']); | |||||
| this.location.back(); | |||||
| } | } | ||||
| } | } | ||||