clean code

This commit is contained in:
Chneemann 2024-06-01 03:59:47 +02:00
parent 71b0654ce7
commit 9065968fe5
2 changed files with 4 additions and 4 deletions

View file

@ -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);

View file

@ -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}`);