Merge branch 'master' of ssh://github.com/nylas/k2

This commit is contained in:
Ben Gotow 2016-07-13 18:26:49 -07:00
commit ec9f8581f7
2 changed files with 6 additions and 20 deletions

View file

@ -92,25 +92,11 @@ module.exports = (sequelize, Sequelize) => {
if (this.folder_id && !this.folder) {
throw new Error("Message.toJSON called on a message where folder were not eagerly loaded.")
}
return {
id: this.id,
account_id: this.accountId,
object: 'message',
body: this.body,
subject: this.subject,
snippet: this.snippet,
to: this.to,
from: this.from,
cc: this.cc,
bcc: this.bcc,
reply_to: this.replyTo,
date: this.date.getTime() / 1000.0,
unread: this.unread,
starred: this.starred,
folder: this.folder,
thread_id: this.threadId,
};
const json = Object.assign({object: 'message'}, this.dataValues)
if (json.date) {
json.date = json.date.getTime() / 1000.0
}
return json
},
},
});

View file

@ -4,7 +4,7 @@ class MiniAccount extends React.Component {
calculateColor() {
// in milliseconds
const grayAfter = 10000;
const grayAfter = 1000 * 60 * 10; // 10 minutes
const elapsedTime = Date.now() - this.props.account.last_sync_completions[0];
let opacity = 0;
if (elapsedTime < grayAfter) {