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 d4d40ec..84ef3c6 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 @@ -212,7 +212,7 @@ export class ChatMsgBoxComponent { if (messageData) { await addDoc(messageRef, messageData) .then((docRef) => { - this.downloadFilesService.loadAllFiles(docRef.id); + this.downloadFilesService.uploadAllFiles(docRef.id); }) .catch((error) => { console.error('Error adding document: ', error); diff --git a/src/app/service/download-files.service.ts b/src/app/service/download-files.service.ts index 9702d53..2b5791e 100644 --- a/src/app/service/download-files.service.ts +++ b/src/app/service/download-files.service.ts @@ -23,10 +23,10 @@ export class DownloadFilesService { } /** - * Loads all files and then lists them. - * @param {string} docID - The document ID under which the files are to be saved. + * Uploads all files and updates the list. + * @param {string} docID - The documentId under which the files are to be saved. */ - loadAllFiles(docID: string) { + uploadAllFiles(docID: string) { const storage = getStorage(); for (const file of this.uploadFiles) { const storageRef = ref(storage, `chatFiles/${docID}/${file.name}`);