Skip to content

Commit

Permalink
Cleanup #243 a little
Browse files Browse the repository at this point in the history
  • Loading branch information
benwinding committed Nov 10, 2022
1 parent 3af5e3c commit 5a6bdec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/providers/database/FireClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ export class FireClient {
await Promise.all(
uploads.map(async (u) => {

const fileNameBits = u.rawFile instanceof File ? u.rawFile.name.split('.') ?? null : null;
const fileNameBits = u.rawFile instanceof File ? u.rawFile.name.split('.') : [];

const extension = fileNameBits === null || fileNameBits.length === 0 ? '' : '.' + fileNameBits.pop();
const fileExtension = !fileNameBits?.length ? '' : '.' + fileNameBits.pop();

const link = await this.uploadAndGetLink(
u.rawFile,
docPath,
u.fieldSlashesPath + extension,
u.fieldSlashesPath + fileExtension,
!!this.options.useFileNamesInStorage
);
set(data, u.fieldDotsPath + ".src", link);
Expand Down

0 comments on commit 5a6bdec

Please sign in to comment.