clean code & bugfixes
This commit is contained in:
parent
7e2b04771f
commit
3f013da226
6 changed files with 17 additions and 28 deletions
|
|
@ -55,10 +55,10 @@ export class AppComponent {
|
|||
const startTime = localStorage.getItem('sessionTimeJOIN');
|
||||
|
||||
if (startTime) {
|
||||
const startTimeMillis = parseInt(startTime);
|
||||
const startTimeMills = parseInt(startTime);
|
||||
const currentTime = new Date().getTime();
|
||||
const timeDifference = 12 * 60 * 60 * 1000; // 12h
|
||||
if (currentTime - startTimeMillis > timeDifference) {
|
||||
if (currentTime - startTimeMills > timeDifference) {
|
||||
localStorage.clear();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,10 +5,8 @@ import { FormBtnComponent } from '../../../shared/components/buttons/form-btn/fo
|
|||
import { FooterComponent } from '../footer/footer.component';
|
||||
import { HeaderComponent } from '../header/header.component';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { FirebaseService } from '../../../services/firebase.service';
|
||||
import { LoginService } from '../../../services/login.service';
|
||||
import { SharedService } from '../../../services/shared.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { BtnBackComponent } from '../../../shared/components/buttons/btn-back/btn-back.component';
|
||||
|
||||
@Component({
|
||||
|
|
@ -32,27 +30,18 @@ export class ForgotPwComponent {
|
|||
};
|
||||
|
||||
constructor(
|
||||
private firebaseService: FirebaseService,
|
||||
public loginSerivce: LoginService,
|
||||
public sharedService: SharedService,
|
||||
private router: Router
|
||||
public loginService: LoginService,
|
||||
public sharedService: SharedService
|
||||
) {}
|
||||
|
||||
onSubmit(ngForm: NgForm) {
|
||||
this.sharedService.isBtnDisabled = true;
|
||||
if (ngForm.submitted && ngForm.form.valid) {
|
||||
this.loginSerivce.passwordReset(this.pwResetData.mail.toLowerCase());
|
||||
this.loginService.passwordReset(this.pwResetData.mail.toLowerCase());
|
||||
}
|
||||
}
|
||||
|
||||
existEmailonServer(mail: string) {
|
||||
return this.firebaseService
|
||||
.getAllUsers()
|
||||
.filter((user) => user.email === mail);
|
||||
}
|
||||
|
||||
checkIfUserEmailIsValid(emailValue: string) {
|
||||
const channelNameLenght = emailValue.length;
|
||||
const emailRegex = /^[\w.%+-]+@[\w.-]+\.[a-zA-Z]{2,}$/;
|
||||
if (emailRegex.test(emailValue)) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@
|
|||
!sharedService.isBtnDisabled) {
|
||||
<p>{{ "register.errorMail1" | translate }}</p>
|
||||
} @else { @if
|
||||
(existEmailonServer(registerData.mail.toLowerCase()).length > 0 &&
|
||||
(existEmailOnServer(registerData.mail.toLowerCase()).length > 0 &&
|
||||
!sharedService.isBtnDisabled) {
|
||||
<p>{{ "register.errorMail2" | translate }}</p>
|
||||
} } }
|
||||
|
|
@ -87,7 +87,7 @@
|
|||
id="password"
|
||||
name="password"
|
||||
#password="ngModel"
|
||||
[type]="loginSerivce.passwordFieldType"
|
||||
[type]="loginService.passwordFieldType"
|
||||
placeholder="{{ 'register.password' | translate }}"
|
||||
class="custom-input"
|
||||
autocomplete="new-password"
|
||||
|
|
@ -104,8 +104,8 @@
|
|||
} @else {
|
||||
<img
|
||||
class="passwordEye"
|
||||
(click)="loginSerivce.togglePasswordVisibility()"
|
||||
[src]="loginSerivce.passwordIcon"
|
||||
(click)="loginService.togglePasswordVisibility()"
|
||||
[src]="loginService.passwordIcon"
|
||||
/>
|
||||
}
|
||||
<div class="error-msg">
|
||||
|
|
@ -122,7 +122,7 @@
|
|||
id="passwordConfirm"
|
||||
name="passwordConfirm"
|
||||
#passwordConfirm="ngModel"
|
||||
[type]="loginSerivce.passwordFieldType"
|
||||
[type]="loginService.passwordFieldType"
|
||||
placeholder="{{ 'register.passwordConfirm' | translate }}"
|
||||
class="custom-input"
|
||||
autocomplete="new-password"
|
||||
|
|
@ -139,8 +139,8 @@
|
|||
} @else {
|
||||
<img
|
||||
class="passwordEyeConfirm"
|
||||
(click)="loginSerivce.togglePasswordVisibility()"
|
||||
[src]="loginSerivce.passwordIcon"
|
||||
(click)="loginService.togglePasswordVisibility()"
|
||||
[src]="loginService.passwordIcon"
|
||||
/>
|
||||
}
|
||||
<div class="error-msg">
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export class RegisterComponent {
|
|||
|
||||
constructor(
|
||||
private firebaseService: FirebaseService,
|
||||
public loginSerivce: LoginService,
|
||||
public loginService: LoginService,
|
||||
public sharedService: SharedService,
|
||||
public translateService: TranslateService
|
||||
) {}
|
||||
|
|
@ -51,7 +51,7 @@ export class RegisterComponent {
|
|||
this.sharedService.isBtnDisabled = true;
|
||||
if (ngForm.submitted && ngForm.form.valid) {
|
||||
this.splitName();
|
||||
this.loginSerivce.register(this.registerData);
|
||||
this.loginService.register(this.registerData);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -61,7 +61,7 @@ export class RegisterComponent {
|
|||
this.registerData.lastName = names.slice(1).join(' ');
|
||||
}
|
||||
|
||||
existEmailonServer(mail: string) {
|
||||
existEmailOnServer(mail: string) {
|
||||
return this.firebaseService
|
||||
.getAllUsers()
|
||||
.filter((user) => user.email === mail);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
'switch-language': languageService.currentLang == 'de'
|
||||
}"
|
||||
>
|
||||
<img src="./assets/img/sidebar/summary.svg" alt="sumary" /><span>{{
|
||||
<img src="./assets/img/sidebar/summary.svg" alt="summary" /><span>{{
|
||||
"sidebar.summary" | translate
|
||||
}}</span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@
|
|||
},
|
||||
"contactDeleteDialog": {
|
||||
"deleteContact": "Möchten Sie den Kontakt wirklich löschen?",
|
||||
"btnCancle": "Abbrechen",
|
||||
"btnCancel": "Abbrechen",
|
||||
"btnDelete": "Löschen"
|
||||
},
|
||||
"summary": {
|
||||
|
|
|
|||
Loading…
Reference in a new issue