bitwarden-estensione-browser/libs/common/src/models/view/sendFileView.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
555 B
TypeScript
Raw Normal View History

import { SendFile } from "../domain/sendFile";
2022-02-22 15:39:11 +01:00
import { View } from "./view";
export class SendFileView implements View {
id: string = null;
size: string = null;
sizeName: string = null;
fileName: string = null;
constructor(f?: SendFile) {
if (!f) {
return;
}
this.id = f.id;
this.size = f.size;
this.sizeName = f.sizeName;
2021-12-16 13:36:21 +01:00
}
get fileSize(): number {
try {
if (this.size != null) {
return parseInt(this.size, null);
}
} catch {
// Invalid file size.
}
return 0;
2021-12-16 13:36:21 +01:00
}
}