Include File size in SendRequest (#289)

This commit is contained in:
Matt Gibson 2021-03-02 09:46:46 -06:00 committed by GitHub
parent 70654926ad
commit 3942868cf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

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

View File

@ -127,7 +127,7 @@ export class SendService implements SendServiceAbstraction {
}
async saveWithServer(sendData: [Send, ArrayBuffer]): Promise<any> {
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) {