mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-27 19:19:21 +03:00
Some improvements, as found while investigating #322
This commit is contained in:
parent
5fb78bcd80
commit
c5cf9fc71d
3 changed files with 43 additions and 116 deletions
|
|
@ -1,4 +1,3 @@
|
|||
import { pInt } from 'Common/Utils';
|
||||
import { FileInfo } from 'Common/File';
|
||||
|
||||
import { AbstractModel } from 'Knoin/AbstractModel';
|
||||
|
|
@ -59,39 +58,6 @@ export class ComposeAttachmentModel extends AbstractModel {
|
|||
});
|
||||
}
|
||||
|
||||
static fromAttachment(item)
|
||||
{
|
||||
const attachment = new ComposeAttachmentModel(
|
||||
item.download,
|
||||
item.fileName,
|
||||
item.estimatedSize,
|
||||
item.isInline(),
|
||||
item.isLinked(),
|
||||
item.cid,
|
||||
item.contentLocation
|
||||
);
|
||||
attachment.fromMessage = true;
|
||||
return attachment;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {FetchJsonComposeAttachment} json
|
||||
* @returns {boolean}
|
||||
*/
|
||||
initByUploadJson(json) {
|
||||
let bResult = false;
|
||||
if (json) {
|
||||
this.fileName(json.Name);
|
||||
this.size(undefined === json.Size ? 0 : pInt(json.Size));
|
||||
this.tempName(undefined === json.TempName ? '' : json.TempName);
|
||||
this.isInline = false;
|
||||
|
||||
bResult = true;
|
||||
}
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue