From 3942868cf488ed8c1983ffadab2c8900b8c78410 Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Tue, 2 Mar 2021 09:46:46 -0600 Subject: [PATCH] Include File size in SendRequest (#289) --- src/models/request/sendRequest.ts | 4 +++- src/services/send.service.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/models/request/sendRequest.ts b/src/models/request/sendRequest.ts index 035fe8e03f..e07804e96a 100644 --- a/src/models/request/sendRequest.ts +++ b/src/models/request/sendRequest.ts @@ -7,6 +7,7 @@ import { Send } from '../domain/send'; export class SendRequest { type: SendType; + fileLength?: number; name: string; notes: string; key: string; @@ -18,8 +19,9 @@ export class SendRequest { password: string; disabled: boolean; - constructor(send: Send) { + constructor(send: Send, fileLength?: number) { this.type = send.type; + this.fileLength = fileLength; this.name = send.name ? send.name.encryptedString : null; this.notes = send.notes ? send.notes.encryptedString : null; this.maxAccessCount = send.maxAccessCount; diff --git a/src/services/send.service.ts b/src/services/send.service.ts index 27d1cb9ff6..c589e96981 100644 --- a/src/services/send.service.ts +++ b/src/services/send.service.ts @@ -127,7 +127,7 @@ export class SendService implements SendServiceAbstraction { } async saveWithServer(sendData: [Send, ArrayBuffer]): Promise { - const request = new SendRequest(sendData[0]); + const request = new SendRequest(sendData[0], sendData[1]?.byteLength); let response: SendResponse; if (sendData[0].id == null) { if (sendData[0].type === SendType.Text) {