Implement attachment downloading

master
Vitaliy Filippov 2019-05-19 15:25:33 +03:00
parent c2b841d757
commit 1641162813
3 changed files with 7 additions and 2 deletions

View File

@ -118,7 +118,11 @@ export default class MessageView extends React.PureComponent
<div className="header">
<div className="field">Attachments</div>
<div className="value">
{msg.props.attachments.map(a => <a className="button" title={a[0]}>{a[0]+' ('+Util.formatBytes(a[2])+')'}</a>)}
{msg.props.attachments.map(a => (
<a className="button" title={a.name} href={"backend/attachment/?msgId="+msg.id+"&sha1="+a.sha1} target="_blank">
{a.name+' ('+Util.formatBytes(a.size)+')'}
</a>
))}
</div>
</div>
: null}

View File

@ -91,6 +91,7 @@ button, a.button
vertical-align: top;
cursor: default;
outline: 0;
color: black;
text-decoration: none;
background: transparent;
border-color: transparent;

View File

@ -74,7 +74,7 @@ class MainWindow extends React.PureComponent
{ name: _('Unread'), icon: 'mail_unread', unreadCount: 0, type: 'unread' },
{ name: _('Received'), icon: 'mail_received', unreadCount: 0, type: 'inbox' },
{ name: _('Pinned'), icon: 'mail_pinned', unreadCount: 0, type: 'pinned' },
{ name: _('Outbox'), icon: 'mail_outbox', unreadCount: 0, type: 'outbox' },
{ name: _('Outbox'), icon: 'mail_outbox', unreadCount: 0, type: 'outbox' }, // FIXME
{ name: _('Sent'), icon: 'mail_sent', unreadCount: 0, type: 'sent' },
{ name: _('Drafts'), icon: 'mail_drafts', unreadCount: 0, type: 'drafts' },
{ name: _('Spam'), icon: 'mail_spam', unreadCount: 0, type: 'spam' },