From 070670137874422b0b917655c36ed435364cf34d Mon Sep 17 00:00:00 2001 From: Halla Moore Date: Wed, 13 Jul 2016 18:00:17 -0700 Subject: [PATCH 1/2] Make the grayAfter time more appropriate for production, 10 mins --- packages/nylas-dashboard/public/js/mini-account.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nylas-dashboard/public/js/mini-account.jsx b/packages/nylas-dashboard/public/js/mini-account.jsx index 8d6d5a785..cd3539470 100644 --- a/packages/nylas-dashboard/public/js/mini-account.jsx +++ b/packages/nylas-dashboard/public/js/mini-account.jsx @@ -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) { From a07174cc4e4678d0900085ad47e1e38dacfc4623 Mon Sep 17 00:00:00 2001 From: Annie Date: Wed, 13 Jul 2016 18:18:59 -0700 Subject: [PATCH 2/2] fixed json parsing of message --- packages/nylas-core/models/account/message.js | 24 ++++--------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/packages/nylas-core/models/account/message.js b/packages/nylas-core/models/account/message.js index 4db6f4d24..024e36fdf 100644 --- a/packages/nylas-core/models/account/message.js +++ b/packages/nylas-core/models/account/message.js @@ -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 }, }, });