Ver código fonte

Facebook login post welcome redirects user back to the old page

master
kj1352 4 anos atrás
pai
commit
78a5d4c80b
3 arquivos alterados com 6 adições e 7 exclusões
  1. +1
    -1
      src/app/components/facebook-login/facebook-login.component.html
  2. +0
    -1
      src/app/home/home.page.ts
  3. +5
    -5
      src/app/welcome/welcome.page.ts

+ 1
- 1
src/app/components/facebook-login/facebook-login.component.html Ver arquivo

@@ -11,7 +11,7 @@
<section class="social-login" [ngClass]="{'active' : showLogout && user }">
<section class="login-box" *ngIf="user">
<button (click)="logout()">
Logout & Exit from "{{ user.name }}"?
Logout & Exit?
</button>
<button (click)="showLogout = false">
<ion-icon name="close-circle-outline"></ion-icon>


+ 0
- 1
src/app/home/home.page.ts Ver arquivo

@@ -129,7 +129,6 @@ export class HomePage implements OnInit {

ionViewDidEnter() {
this.userService.getUserProfile().then((data: any) => {
alert(JSON.stringify(data));
this.liked_articles = data.liked_articles;
this.bookmarked_articles = data.bookmarked_articles;
}, () => {


+ 5
- 5
src/app/welcome/welcome.page.ts Ver arquivo

@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Location } from '@angular/common';

@Component({
selector: 'app-welcome',
@@ -10,20 +10,20 @@ export class WelcomePage implements OnInit {
user: any;

constructor(
private router: Router
private location: Location
) { }

ngOnInit() {
if (localStorage.getItem('FBUser')) {
this.user = JSON.parse(localStorage.getItem('FBUser'));
setTimeout(() => {
this.router.navigate(['/tabs/home']);
setTimeout(() => {
this.location.back();
}, 3000);
} else {
this.user = null;
this.router.navigate(['/tabs/home']);
this.location.back();
}
}



Carregando…
Cancelar
Salvar