Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Commit bbab55b

Browse files
authored
Feature/account popup null (#14)
* remove useless console * close account popup if defined and not nul * follow codacy feedback * lint * use typeof undefined instead of match&
1 parent 6ac095a commit bbab55b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

projects/cryptr/cryptr-angular/src/lib/account-access-button/account-access-button.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class AccountAccessButtonComponent implements OnChanges {
5656
errorBtnClass = ERROR_BTN_CLASS;
5757

5858
closeAccountPopup(): void {
59-
if (this.accountPopup !== undefined) {
59+
if (typeof this.accountPopup !== 'undefined' && this.accountPopup !== null) {
6060
this.accountPopup.close();
6161
}
6262
}
@@ -168,14 +168,14 @@ export class AccountAccessButtonComponent implements OnChanges {
168168
}
169169

170170
initials(): any {
171-
if (!this.isAuthenticated() || this.user() === undefined || this.fullName() === undefined) {
171+
if (!this.isAuthenticated() || typeof this.user() === 'undefined' || typeof this.fullName() === 'undefined') {
172172
return;
173173
}
174174
return this.fullName().match(/\b(\w)/g).join('');
175175
}
176176

177177
fullName(): any {
178-
if (!this.isAuthenticated() || this.user() === undefined || this.email() === undefined) {
178+
if (!this.isAuthenticated() || typeof this.user() === 'undefined' || typeof this.email() === 'undefined') {
179179
return;
180180
}
181181
const emailName = this.email().split('@')[0];

projects/playground/src/app/components/nav/nav.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export class NavComponent implements OnInit {
2727
ngOnInit(): void {
2828
this.cryptrListeners();
2929
this.auth.currentAuthenticationObservable().subscribe((isAuthenticated: boolean) => {
30-
console.log(isAuthenticated);
3130
this.authenticated = isAuthenticated;
3231
});
3332
this.auth.getObservableUser().subscribe((user) => {

0 commit comments

Comments
 (0)