bugfixes, clean code
This commit is contained in:
parent
20f52ae411
commit
97348d048f
7 changed files with 40 additions and 23 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -45,4 +45,4 @@ Thumbs.db
|
|||
.firebase
|
||||
*-debug.log
|
||||
.runtimeconfig.json
|
||||
/src/app/environments/config.ts
|
||||
src/environments/config.ts
|
||||
|
|
@ -8,7 +8,7 @@ import { provideStorage, getStorage } from '@angular/fire/storage';
|
|||
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
|
||||
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
|
||||
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
|
||||
import { firebaseConfig } from './environments/config';
|
||||
import { firebaseConfig } from '../environments/config';
|
||||
|
||||
export function HttpLoaderFactory(httpClient: HttpClient) {
|
||||
return new TranslateHttpLoader(httpClient, './assets/i18n/', '.json');
|
||||
|
|
|
|||
|
|
@ -24,15 +24,6 @@
|
|||
(click)="addReactionIcon('clap-hands', currentChat)"
|
||||
>
|
||||
</app-small-btn>
|
||||
<app-small-btn
|
||||
[imgSrc]="'add-reaction.svg'"
|
||||
[imgSize]="viewWidth >= RESPONSIVE_THRESHOLD_MOBILE ? '24px' : '17px'"
|
||||
[btnSize]="viewWidth >= RESPONSIVE_THRESHOLD_MOBILE ? '36px' : '25px'"
|
||||
[btnBgHoverColor]="'#edeefe'"
|
||||
[ngClass]="{ mirror: user.id === userService.getCurrentUserId() }"
|
||||
(click)="toggleEmojiPicker()"
|
||||
>
|
||||
</app-small-btn>
|
||||
@if (!isPrivatChannel) {
|
||||
<app-small-btn
|
||||
[imgSrc]="'answer.svg'"
|
||||
|
|
@ -81,13 +72,25 @@
|
|||
} @else {
|
||||
<div class="content">
|
||||
<app-small-btn
|
||||
[imgSrc]="'add-reaction.svg'"
|
||||
[imgSrc]="'okay.svg'"
|
||||
[imgSize]="viewWidth >= RESPONSIVE_THRESHOLD_MOBILE ? '24px' : '17px'"
|
||||
[btnSize]="viewWidth >= RESPONSIVE_THRESHOLD_MOBILE ? '36px' : '25px'"
|
||||
[imgFilter]="'none'"
|
||||
[btnBgHoverColor]="'#edeefe'"
|
||||
[ngClass]="{ mirror: user.id === userService.getCurrentUserId() }"
|
||||
(click)="toggleEmojiPicker()"
|
||||
></app-small-btn>
|
||||
(click)="addReactionIcon('okay', currentChat)"
|
||||
>
|
||||
</app-small-btn>
|
||||
<app-small-btn
|
||||
[imgSrc]="'clap-hands.svg'"
|
||||
[imgSize]="viewWidth >= RESPONSIVE_THRESHOLD_MOBILE ? '24px' : '17px'"
|
||||
[btnSize]="viewWidth >= RESPONSIVE_THRESHOLD_MOBILE ? '36px' : '25px'"
|
||||
[imgFilter]="'none'"
|
||||
[btnBgHoverColor]="'#edeefe'"
|
||||
[ngClass]="{ mirror: user.id === userService.getCurrentUserId() }"
|
||||
(click)="addReactionIcon('clap-hands', currentChat)"
|
||||
>
|
||||
</app-small-btn>
|
||||
@if (user.id === userService.getCurrentUserId()) {
|
||||
<app-small-btn
|
||||
[imgSrc]="'more-vertical.svg'"
|
||||
|
|
|
|||
|
|
@ -246,4 +246,7 @@ button {
|
|||
.loginContainer {
|
||||
max-width: 306px;
|
||||
}
|
||||
.error {
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,4 +132,7 @@ button {
|
|||
max-width: 306px;
|
||||
gap: 12px !important;
|
||||
}
|
||||
.error {
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ export interface MessageData {
|
|||
message: string;
|
||||
publishedTimestamp: number;
|
||||
userId: string;
|
||||
channelId?: string;
|
||||
chatId?: string;
|
||||
channelId: string;
|
||||
chatId: string;
|
||||
edited: boolean;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,7 +166,6 @@ export class loginService {
|
|||
email: this.email,
|
||||
status: true,
|
||||
};
|
||||
|
||||
this.createUserInFirestore(userDataToSave);
|
||||
this.deleteUserFormData();
|
||||
})
|
||||
|
|
@ -176,6 +175,15 @@ export class loginService {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears user forms data.
|
||||
*/
|
||||
deleteUserFormData() {
|
||||
this.name = '';
|
||||
this.email = '';
|
||||
this.password = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves user data to Firestore and updates the application state.
|
||||
* @param user The user object containing information to be saved.
|
||||
|
|
@ -369,18 +377,18 @@ export class loginService {
|
|||
window.location.reload();
|
||||
}
|
||||
|
||||
deleteUserFormData() {
|
||||
this.name = '';
|
||||
this.email = '';
|
||||
this.password = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles password visibility.
|
||||
*/
|
||||
togglePasswordVisibility() {
|
||||
this.passwordFieldType =
|
||||
this.passwordFieldType === 'password' ? 'text' : 'password';
|
||||
this.toggleIcon();
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles password icon.
|
||||
*/
|
||||
toggleIcon() {
|
||||
this.passwordIcon =
|
||||
this.passwordIcon === './assets/img/login/close-eye.svg'
|
||||
|
|
|
|||
Loading…
Reference in a new issue