slicing dashboard
This commit is contained in:
@@ -5,6 +5,7 @@ import { ToastrService } from "ngx-toastr";
|
||||
import { jwtDecode } from "jwt-decode";
|
||||
import { AuthService } from "src/app/_services/auth.service";
|
||||
import { Router } from "@angular/router";
|
||||
import * as _ from "lodash"
|
||||
interface CustomJwtPayload {
|
||||
exp: number;
|
||||
scope: string;
|
||||
@@ -30,7 +31,7 @@ export class ProfilInformationComponent {
|
||||
storedData: any;
|
||||
currentUser: any;
|
||||
disableButton: boolean = false;
|
||||
|
||||
oldData: any;
|
||||
url: any = "https://www.w3schools.com/howto/img_avatar.png";
|
||||
fileSelected: any = null;
|
||||
|
||||
@@ -40,7 +41,22 @@ export class ProfilInformationComponent {
|
||||
private toastr: ToastrService,
|
||||
public logoutService: AuthService,
|
||||
private router: Router
|
||||
) {}
|
||||
) {
|
||||
this.authService._tabSelected.subscribe(res => {
|
||||
console.log(res);
|
||||
console.log(this.oldData);
|
||||
console.log(this.profilInfo.value);
|
||||
if (res === "update-password") {
|
||||
if (this.oldData !== this.profilInfo.value) {
|
||||
console.log('ada perubahan');
|
||||
return false
|
||||
} else {
|
||||
console.log('tidak ada perubahan');
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.storedData = JSON.parse(localStorage.getItem("account_info"));
|
||||
@@ -69,6 +85,10 @@ export class ProfilInformationComponent {
|
||||
phone: data.data.phone,
|
||||
image: [null],
|
||||
});
|
||||
// this.oldData._.cloneDeep(this.profilInfo.value);
|
||||
this.oldData = _.cloneDeep(this.profilInfo.value)
|
||||
console.log(this.oldData);
|
||||
|
||||
if (
|
||||
data.data.image_path !== "https://kapi.absys.ninja/hemat/image/null"
|
||||
) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Component } from "@angular/core";
|
||||
import { LoginService } from "../service/login.service";
|
||||
|
||||
@Component({
|
||||
selector: "app-user-profile",
|
||||
@@ -10,11 +11,12 @@ export class UserProfileComponent {
|
||||
|
||||
activeTab: string = "profile-info2";
|
||||
|
||||
constructor() {}
|
||||
constructor(private loginService: LoginService) {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
||||
selectTab(tabName: string) {
|
||||
this.activeTab = tabName;
|
||||
this.loginService.setTabsSelected(tabName)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user