Add 'from' and 'received at' to the email summary.
Really useful in deciding what to read.
This commit is contained in:
		
							parent
							
								
									d71f18cce1
								
							
						
					
					
						commit
						5c293219f3
					
				
					 3 changed files with 18 additions and 3 deletions
				
			
		|  | @ -48,11 +48,16 @@ class EmailSummary extends React.Component< | |||
| 			this.props.mailbox.id + | ||||
| 			"/" + | ||||
| 			this.props.emailId; | ||||
| 		const stub = this.props.emailStub; | ||||
| 		return ( | ||||
| 			<div className="p-2 border" key={this.props.emailId}> | ||||
| 				<a className="btn" href={href}> | ||||
| 					{this.props.emailStub != null | ||||
| 						? this.props.emailStub.subject | ||||
| 					{stub != null | ||||
| 						? stub.receivedAt + | ||||
| 							" - " + | ||||
| 							(stub.from == null ? "?" : stub.from[0].name) + | ||||
| 							" - " + | ||||
| 							stub.subject | ||||
| 						: this.props.emailId} | ||||
| 				</a> | ||||
| 			</div> | ||||
|  |  | |||
|  | @ -148,7 +148,7 @@ export default class Client { | |||
| 			.email_get({ | ||||
| 				accountId: accountId, | ||||
| 				ids: [emailId], | ||||
| 				properties: ["subject"], | ||||
| 				properties: ["from", "receivedAt", "subject"], | ||||
| 			}) | ||||
| 			.then((response) => { | ||||
| 				console.log(msg, "response", response); | ||||
|  | @ -161,7 +161,9 @@ export default class Client { | |||
| 						); | ||||
| 					} | ||||
| 					this.state.session.emailStubs[e.id] = { | ||||
| 						from: e.from, | ||||
| 						id: e.id, | ||||
| 						receivedAt: e.receivedAt, | ||||
| 						subject: e.subject, | ||||
| 					}; | ||||
| 					this._triggerChange(msg + e.id); | ||||
|  | @ -181,6 +183,12 @@ export default class Client { | |||
| 			.email_query({ | ||||
| 				accountId: accountId, | ||||
| 				filter: { inMailbox: mailboxId }, | ||||
| 				sort: [ | ||||
| 					{ | ||||
| 						property: "receivedAt", | ||||
| 						isAscending: false, | ||||
| 					}, | ||||
| 				], | ||||
| 			}) | ||||
| 			.then((response) => { | ||||
| 				const mailbox = this.mailbox(accountId, mailboxId); | ||||
|  |  | |||
|  | @ -1,7 +1,9 @@ | |||
| import client from "jmap-client-ts/lib/types"; | ||||
| 
 | ||||
| export interface IEmailStub { | ||||
| 	from: Array<client.IEmailAddress> | null; | ||||
| 	id: string; | ||||
| 	receivedAt: string; | ||||
| 	subject: string; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue