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

@Component({
    selector: 'app-profile',
    templateUrl: './profile.page.html',
    styleUrls: ['./profile.page.scss'],
})
export class ProfilePage implements OnInit {
    selected_tab: string = 'MY ORDERS';

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

    ngOnInit() {
    }

	ionViewDidEnter() {
		this.selected_tab = '';
		setTimeout(() => {
			this.selected_tab = 'MY ORDERS';
		}, 100);
	}

    back() {
        this.location.back();
    }

	logout() {
		localStorage.clear();
		this.router.navigate(['login']);
	}

}
