Skip to content

Commit

Permalink
fix: use clientName only when drive.name is fake
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Apr 8, 2022
1 parent afd9ff5 commit 6c1517b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Multipart/File.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,12 @@ export class File implements MultipartFileContract {
diskName?: keyof DisksList
): Promise<void> {
const driver = diskName ? this.drive.use(diskName) : this.drive.use()

const fileName =
options?.name || (driver.name as any) === 'fake'
(driver.name as any) === 'fake'
? this.clientName
: options?.name
? options.name
: `${cuid()}.${this.extname}`

/**
Expand Down

0 comments on commit 6c1517b

Please sign in to comment.