ソースを参照

Facebook login post welcome redirects user back to the old page

master
kj1352 4年前
コミット
78a5d4c80b
3個のファイルの変更6行の追加7行の削除
  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 ファイルの表示

@@ -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>


+ 0
- 1
src/app/home/home.page.ts ファイルの表示

@@ -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;
}, () => { }, () => {


+ 5
- 5
src/app/welcome/welcome.page.ts ファイルの表示

@@ -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();
} }
} }




読み込み中…
キャンセル
保存