diff --git a/src/app/components/main-chat/channel-informations/channel-informations.component.ts b/src/app/components/main-chat/channel-informations/channel-informations.component.ts index 32965cc..83fd8ab 100644 --- a/src/app/components/main-chat/channel-informations/channel-informations.component.ts +++ b/src/app/components/main-chat/channel-informations/channel-informations.component.ts @@ -2,7 +2,7 @@ import { CommonModule } from '@angular/common'; import { Component, EventEmitter, Input, Output } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { Channel } from '../../../interface/channel.interface'; -import { ChannleService } from '../../../service/channle.service'; +import { ChannelService } from '../../../service/channel.service'; import { UserService } from '../../../service/user.service'; import { Router } from '@angular/router'; import { User } from '../../../interface/user.interface'; @@ -40,7 +40,7 @@ export class ChannelInformationsComponent { constructor( private route: Router, - public channelService: ChannleService, + public channelService: ChannelService, public userService: UserService, private sharedService: SharedService ) {} diff --git a/src/app/components/main-chat/chat-content/chat-content.component.ts b/src/app/components/main-chat/chat-content/chat-content.component.ts index 80d2488..5c2174c 100644 --- a/src/app/components/main-chat/chat-content/chat-content.component.ts +++ b/src/app/components/main-chat/chat-content/chat-content.component.ts @@ -14,7 +14,7 @@ import { SingleChatComponent } from '../single-chat/single-chat.component'; import { ChatMsgBoxComponent } from '../chat-msg-box/chat-msg-box.component'; import { CommonModule } from '@angular/common'; import { DownloadFilesService } from '../../../service/download-files.service'; -import { ChannleService } from '../../../service/channle.service'; +import { ChannelService } from '../../../service/channel.service'; import { InfoComponent } from '../info/info.component'; @Component({ @@ -45,7 +45,7 @@ export class ChatContentComponent implements AfterViewInit, AfterViewChecked { constructor( private chatService: ChatService, private userService: UserService, - public channelService: ChannleService, + public channelService: ChannelService, private downloadFilesService: DownloadFilesService, private renderer: Renderer2 ) {} diff --git a/src/app/components/main-chat/chat-msg-box/chat-msg-box.component.ts b/src/app/components/main-chat/chat-msg-box/chat-msg-box.component.ts index 56d5e42..3e3741e 100644 --- a/src/app/components/main-chat/chat-msg-box/chat-msg-box.component.ts +++ b/src/app/components/main-chat/chat-msg-box/chat-msg-box.component.ts @@ -16,7 +16,7 @@ import { EmojiPickerComponent } from '../../../shared/components/emoji-picker/em import { SmallBtnComponent } from '../../../shared/components/small-btn/small-btn.component'; import { ChatService } from '../../../service/chat.service'; import { Router } from '@angular/router'; -import { ChannleService } from '../../../service/channle.service'; +import { ChannelService } from '../../../service/channel.service'; import { ToggleBooleanService } from '../../../service/toggle-boolean.service'; import { User } from '../../../interface/user.interface'; import { MessageData } from '../../../interface/chat.interface'; @@ -69,7 +69,7 @@ export class ChatMsgBoxComponent { private firestore: Firestore, public userService: UserService, private chatService: ChatService, - public channelService: ChannleService, + public channelService: ChannelService, public toggleBoolean: ToggleBooleanService, private sharedService: SharedService ) {} diff --git a/src/app/components/main-chat/info/info.component.ts b/src/app/components/main-chat/info/info.component.ts index cfa1ddf..9329f32 100644 --- a/src/app/components/main-chat/info/info.component.ts +++ b/src/app/components/main-chat/info/info.component.ts @@ -1,5 +1,5 @@ import { Component, Input } from '@angular/core'; -import { ChannleService } from '../../../service/channle.service'; +import { ChannelService } from '../../../service/channel.service'; import { UserService } from '../../../service/user.service'; import { TranslateModule } from '@ngx-translate/core'; @@ -14,7 +14,7 @@ export class InfoComponent { @Input() currentChannel: string = ''; constructor( - private channelService: ChannleService, + private channelService: ChannelService, public userService: UserService ) {} diff --git a/src/app/components/main-chat/main-chat.component.ts b/src/app/components/main-chat/main-chat.component.ts index 20bea93..b8b16d3 100644 --- a/src/app/components/main-chat/main-chat.component.ts +++ b/src/app/components/main-chat/main-chat.component.ts @@ -1,5 +1,5 @@ -import { Component, ElementRef, Input } from '@angular/core'; -import { ChannleService } from '../../service/channle.service'; +import { Component, Input } from '@angular/core'; +import { ChannelService } from '../../service/channel.service'; import { MainComponent } from '../main/main.component'; import { ChatService } from '../../service/chat.service'; import { UserService } from '../../service/user.service'; @@ -9,7 +9,6 @@ import { PrvChannel, publicChannels, } from '../../interface/channel.interface'; -import { Chat } from '../../interface/chat.interface'; import { NavigationStart, Router } from '@angular/router'; import { CommonModule } from '@angular/common'; import { ChatContentComponent } from './chat-content/chat-content.component'; @@ -61,7 +60,7 @@ export class MainChatComponent { constructor( private route: Router, public userService: UserService, - public channelService: ChannleService, + public channelService: ChannelService, public chatService: ChatService, public toggleBoolean: ToggleBooleanService, private sharedService: SharedService diff --git a/src/app/components/main-chat/show-channel-member/open-send-prv-message-window/open-send-prv-message-window.component.ts b/src/app/components/main-chat/show-channel-member/open-send-prv-message-window/open-send-prv-message-window.component.ts index b0b1b48..a696b8c 100644 --- a/src/app/components/main-chat/show-channel-member/open-send-prv-message-window/open-send-prv-message-window.component.ts +++ b/src/app/components/main-chat/show-channel-member/open-send-prv-message-window/open-send-prv-message-window.component.ts @@ -2,7 +2,7 @@ import { CommonModule } from '@angular/common'; import { Component, EventEmitter, Input, Output } from '@angular/core'; import { User } from '../../../../interface/user.interface'; import { ToggleBooleanService } from '../../../../service/toggle-boolean.service'; -import { ChannleService } from '../../../../service/channle.service'; +import { ChannelService } from '../../../../service/channel.service'; import { UserService } from '../../../../service/user.service'; import { Router } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; @@ -25,7 +25,7 @@ export class OpenSendPrvMessageWindowComponent { constructor( public toggleBoolean: ToggleBooleanService, - private channelService: ChannleService, + private channelService: ChannelService, public userService: UserService, private route: Router ) {} diff --git a/src/app/components/main-chat/show-channel-member/show-channel-member.component.ts b/src/app/components/main-chat/show-channel-member/show-channel-member.component.ts index fe29938..89ab11f 100644 --- a/src/app/components/main-chat/show-channel-member/show-channel-member.component.ts +++ b/src/app/components/main-chat/show-channel-member/show-channel-member.component.ts @@ -4,7 +4,7 @@ import { CommonModule } from '@angular/common'; import { SmallBtnComponent } from '../../../shared/components/small-btn/small-btn.component'; import { User } from '../../../interface/user.interface'; import { FormsModule } from '@angular/forms'; -import { ChannleService } from '../../../service/channle.service'; +import { ChannelService } from '../../../service/channel.service'; import { UserService } from '../../../service/user.service'; import { OpenSendPrvMessageWindowComponent } from './open-send-prv-message-window/open-send-prv-message-window.component'; import { TranslateModule } from '@ngx-translate/core'; @@ -40,7 +40,7 @@ export class ShowChannelMemberComponent { constructor( public toggleBoolean: ToggleBooleanService, - public channelService: ChannleService, + public channelService: ChannelService, public userService: UserService ) {} diff --git a/src/app/components/main/main.component.ts b/src/app/components/main/main.component.ts index ccf5edf..78fc1ca 100644 --- a/src/app/components/main/main.component.ts +++ b/src/app/components/main/main.component.ts @@ -15,7 +15,7 @@ import { SidebarComponent } from '../sidebar/sidebar.component'; import { MainChatComponent } from '../main-chat/main-chat.component'; import { SecondaryChatComponent } from '../secondary-chat/secondary-chat.component'; import { ChatService } from '../../service/chat.service'; -import { ChannleService } from '../../service/channle.service'; +import { ChannelService } from '../../service/channel.service'; import { SidebarToggleComponent } from '../sidebar/sidebar-toggle/sidebar-toggle.component'; import { CommonModule } from '@angular/common'; import { AddNewChannelComponent } from '../sidebar/sidebar-channels/add-new-channel/add-new-channel.component'; @@ -44,7 +44,7 @@ export class MainComponent implements OnInit { constructor( public userService: UserService, public chatService: ChatService, - public channelService: ChannleService, + public channelService: ChannelService, private router: Router, private route: ActivatedRoute, public toggleAllBooleans: ToggleBooleanService, diff --git a/src/app/components/secondary-chat/secondary-chat.component.ts b/src/app/components/secondary-chat/secondary-chat.component.ts index f9646cf..c41c30e 100644 --- a/src/app/components/secondary-chat/secondary-chat.component.ts +++ b/src/app/components/secondary-chat/secondary-chat.component.ts @@ -7,7 +7,7 @@ import { ViewChild, } from '@angular/core'; import { UserService } from '../../service/user.service'; -import { ChannleService } from '../../service/channle.service'; +import { ChannelService } from '../../service/channel.service'; import { ChatService } from '../../service/chat.service'; import { MainComponent } from '../main/main.component'; import { SingleChatComponent } from '../main-chat/single-chat/single-chat.component'; @@ -38,7 +38,7 @@ export class SecondaryChatComponent implements AfterViewChecked { constructor( public userService: UserService, - public channelService: ChannleService, + public channelService: ChannelService, public chatService: ChatService, private renderer: Renderer2 ) {} diff --git a/src/app/components/sidebar/show-all-users/show-all-users.component.ts b/src/app/components/sidebar/show-all-users/show-all-users.component.ts index 04a9aea..1b8ee49 100644 --- a/src/app/components/sidebar/show-all-users/show-all-users.component.ts +++ b/src/app/components/sidebar/show-all-users/show-all-users.component.ts @@ -2,7 +2,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; import { UserService } from '../../../service/user.service'; import { User } from '../../../interface/user.interface'; -import { ChannleService } from '../../../service/channle.service'; +import { ChannelService } from '../../../service/channel.service'; import { Router } from '@angular/router'; import { SmallBtnComponent } from '../../../shared/components/small-btn/small-btn.component'; import { ChatService } from '../../../service/chat.service'; @@ -24,7 +24,7 @@ export class ShowAllUsersComponent { constructor( public userService: UserService, private route: Router, - private channelService: ChannleService, + private channelService: ChannelService, private chatService: ChatService, public toggleBoolean: ToggleBooleanService, private sharedService: SharedService diff --git a/src/app/components/sidebar/sidebar-channels/add-new-channel/add-new-channel.component.ts b/src/app/components/sidebar/sidebar-channels/add-new-channel/add-new-channel.component.ts index 7037736..a7c969a 100644 --- a/src/app/components/sidebar/sidebar-channels/add-new-channel/add-new-channel.component.ts +++ b/src/app/components/sidebar/sidebar-channels/add-new-channel/add-new-channel.component.ts @@ -1,6 +1,6 @@ import { CommonModule } from '@angular/common'; import { Component, Input } from '@angular/core'; -import { ChannleService } from '../../../../service/channle.service'; +import { ChannelService } from '../../../../service/channel.service'; import { SmallBtnComponent } from '../../../../shared/components/small-btn/small-btn.component'; import { FormsModule } from '@angular/forms'; import { UserService } from '../../../../service/user.service'; @@ -37,7 +37,7 @@ export class AddNewChannelComponent { showNextWindowMobile: boolean = false; constructor( - public channelService: ChannleService, + public channelService: ChannelService, public userService: UserService, public route: Router, private sharedService: SharedService, diff --git a/src/app/components/sidebar/sidebar-channels/sidebar-channels.component.ts b/src/app/components/sidebar/sidebar-channels/sidebar-channels.component.ts index 9a3dbca..c7bbfe5 100644 --- a/src/app/components/sidebar/sidebar-channels/sidebar-channels.component.ts +++ b/src/app/components/sidebar/sidebar-channels/sidebar-channels.component.ts @@ -1,5 +1,5 @@ import { Component, Input } from '@angular/core'; -import { ChannleService } from '../../../service/channle.service'; +import { ChannelService } from '../../../service/channel.service'; import { Channel, publicChannels } from '../../../interface/channel.interface'; import { RouterLink } from '@angular/router'; import { ChatService } from '../../../service/chat.service'; @@ -33,7 +33,7 @@ export class SidebarChannelsComponent { minimizeChannels: boolean = true; constructor( - public channelService: ChannleService, + public channelService: ChannelService, public chatService: ChatService, public userService: UserService, public toggleBoolean: ToggleBooleanService, diff --git a/src/app/components/sidebar/sidebar-direct-messages-user/sidebar-direct-messages-user.component.ts b/src/app/components/sidebar/sidebar-direct-messages-user/sidebar-direct-messages-user.component.ts index c3e8028..82fc2ad 100644 --- a/src/app/components/sidebar/sidebar-direct-messages-user/sidebar-direct-messages-user.component.ts +++ b/src/app/components/sidebar/sidebar-direct-messages-user/sidebar-direct-messages-user.component.ts @@ -1,7 +1,7 @@ import { Component, Input } from '@angular/core'; import { UserService } from '../../../service/user.service'; import { CommonModule } from '@angular/common'; -import { ChannleService } from '../../../service/channle.service'; +import { ChannelService } from '../../../service/channel.service'; import { RouterLink } from '@angular/router'; import { ChatService } from '../../../service/chat.service'; import { ToggleBooleanService } from '../../../service/toggle-boolean.service'; @@ -22,7 +22,7 @@ export class SidebarDirectMessagesUserComponent { constructor( public userService: UserService, - private channelService: ChannleService, + private channelService: ChannelService, public chatService: ChatService, public toggleBoolean: ToggleBooleanService, private sharedService: SharedService diff --git a/src/app/components/sidebar/sidebar.component.ts b/src/app/components/sidebar/sidebar.component.ts index f91377e..5b847ea 100644 --- a/src/app/components/sidebar/sidebar.component.ts +++ b/src/app/components/sidebar/sidebar.component.ts @@ -4,7 +4,7 @@ import { SidebarChannelsComponent } from './sidebar-channels/sidebar-channels.co import { SidebarDirectMessagesComponent } from './sidebar-direct-messages/sidebar-direct-messages.component'; import { SmallBtnComponent } from '../../shared/components/small-btn/small-btn.component'; import { CommonModule } from '@angular/common'; -import { ChannleService } from '../../service/channle.service'; +import { ChannelService } from '../../service/channel.service'; import { ToggleBooleanService } from '../../service/toggle-boolean.service'; import { ChatService } from '../../service/chat.service'; import { SharedService } from '../../service/shared.service'; @@ -30,7 +30,7 @@ export class SidebarComponent implements OnInit { currentChannel: string = ''; constructor( - public channelService: ChannleService, + public channelService: ChannelService, public toggleBoolean: ToggleBooleanService, private router: ActivatedRoute, public chatService: ChatService, diff --git a/src/app/service/channle.service.ts b/src/app/service/channel.service.ts similarity index 93% rename from src/app/service/channle.service.ts rename to src/app/service/channel.service.ts index 6ddeabd..ea21166 100644 --- a/src/app/service/channle.service.ts +++ b/src/app/service/channel.service.ts @@ -17,7 +17,7 @@ import { ChatService } from './chat.service'; @Injectable({ providedIn: 'root', }) -export class ChannleService implements OnDestroy { +export class ChannelService implements OnDestroy { firestore: Firestore = inject(Firestore); allChannels: Channel[] = []; @@ -44,7 +44,7 @@ export class ChannleService implements OnDestroy { * @param path Path of the collection in Firestore. * @returns Firestore collection reference. */ - firesorePath(path: string) { + firestorePath(path: string) { return collection(this.firestore, path); } @@ -53,7 +53,7 @@ export class ChannleService implements OnDestroy { * @returns Unsubscribe function. */ subChannelList() { - return onSnapshot(this.firesorePath('channels'), (list) => { + return onSnapshot(this.firestorePath('channels'), (list) => { this.allChannels = []; list.forEach((element) => { const channelWithId = { id: element.id, ...element.data() } as Channel; @@ -67,7 +67,7 @@ export class ChannleService implements OnDestroy { * @returns Unsubscribe function. */ subPrvChannelList() { - return onSnapshot(this.firesorePath('prv-channels'), (list) => { + return onSnapshot(this.firestorePath('prv-channels'), (list) => { this.allPrvChannels = []; list.forEach((element) => { const channelWithId = { @@ -107,7 +107,7 @@ export class ChannleService implements OnDestroy { path: string ): Promise { try { - const docRef = await addDoc(this.firesorePath(path), newChannel); + const docRef = await addDoc(this.firestorePath(path), newChannel); this.chatService.getPrvChatId = docRef.id; return docRef.id; } catch (err) { diff --git a/src/app/service/user.service.ts b/src/app/service/user.service.ts index ad01cf4..9bf3627 100644 --- a/src/app/service/user.service.ts +++ b/src/app/service/user.service.ts @@ -7,7 +7,7 @@ import { updateDoc, } from '@angular/fire/firestore'; import { User } from '../interface/user.interface'; -import { ChannleService } from './channle.service'; +import { ChannelService } from './channel.service'; import { getAuth, signOut } from 'firebase/auth'; import { Router } from '@angular/router'; import CryptoJS from 'crypto-es'; @@ -28,7 +28,7 @@ export class UserService implements OnDestroy { unsubUser; - constructor(private channelService: ChannleService, private route: Router) { + constructor(private channelService: ChannelService, private route: Router) { this.unsubUser = this.subUserList(); } diff --git a/src/app/shared/components/header/edit-user/edit-user-details/edit-user-details.component.ts b/src/app/shared/components/header/edit-user/edit-user-details/edit-user-details.component.ts index a19e689..cbf7076 100644 --- a/src/app/shared/components/header/edit-user/edit-user-details/edit-user-details.component.ts +++ b/src/app/shared/components/header/edit-user/edit-user-details/edit-user-details.component.ts @@ -10,7 +10,7 @@ import { import { EditUserComponent } from '../edit-user.component'; import { UserService } from '../../../../../service/user.service'; import { FormsModule, NgForm } from '@angular/forms'; -import { ChannleService } from '../../../../../service/channle.service'; +import { ChannelService } from '../../../../../service/channel.service'; import { TranslateModule } from '@ngx-translate/core'; import { SmallBtnComponent } from '../../../small-btn/small-btn.component'; @@ -43,7 +43,7 @@ export class EditUserDetailsComponent { constructor( public userService: UserService, - public channelService: ChannleService + public channelService: ChannelService ) {} /** Filters whether the user is a guest. */ diff --git a/src/app/shared/components/header/search-bar/search-bar.component.ts b/src/app/shared/components/header/search-bar/search-bar.component.ts index 42c2bc6..194261a 100644 --- a/src/app/shared/components/header/search-bar/search-bar.component.ts +++ b/src/app/shared/components/header/search-bar/search-bar.component.ts @@ -5,7 +5,7 @@ import { Channel } from '../../../../interface/channel.interface'; import { Chat } from '../../../../interface/chat.interface'; import { UserService } from '../../../../service/user.service'; import { ToggleBooleanService } from '../../../../service/toggle-boolean.service'; -import { ChannleService } from '../../../../service/channle.service'; +import { ChannelService } from '../../../../service/channel.service'; import { ChatService } from '../../../../service/chat.service'; import { DomSanitizer } from '@angular/platform-browser'; import { Router, RouterLink } from '@angular/router'; @@ -43,7 +43,7 @@ export class SearchBarComponent { constructor( public userService: UserService, public toggleBoolean: ToggleBooleanService, - private channelService: ChannleService, + private channelService: ChannelService, private chatService: ChatService, public sanitizer: DomSanitizer, private route: Router,