diff --git a/src/EmailSummary.tsx b/src/EmailSummary.tsx index f777e4a..0e57c1e 100644 --- a/src/EmailSummary.tsx +++ b/src/EmailSummary.tsx @@ -48,11 +48,16 @@ class EmailSummary extends React.Component< this.props.mailbox.id + "/" + this.props.emailId; + const stub = this.props.emailStub; return (
diff --git a/src/client/Client.tsx b/src/client/Client.tsx index cc22889..2ed7158 100644 --- a/src/client/Client.tsx +++ b/src/client/Client.tsx @@ -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); diff --git a/src/client/types.tsx b/src/client/types.tsx index 3906350..da345c1 100644 --- a/src/client/types.tsx +++ b/src/client/types.tsx @@ -1,7 +1,9 @@ import client from "jmap-client-ts/lib/types"; export interface IEmailStub { + from: Array