diff --git a/electron_app/src/DBManager.js b/electron_app/src/DBManager.js index f31626f03..69277db60 100644 --- a/electron_app/src/DBManager.js +++ b/electron_app/src/DBManager.js @@ -658,7 +658,6 @@ const baseThreadQuery = ({ ), db.raw(`GROUP_CONCAT(DISTINCT(${Table.FILE}.token)) as fileTokens`), db.raw(`MAX(${Table.EMAIL}.unread) as unread`), - db.raw(`MIN(email.date) as minDate`), db.raw(`MAX(email.date) as maxDate`) ) .from(Table.EMAIL) diff --git a/electron_app/src/__integrations__/__snapshots__/Email.integration.js.snap b/electron_app/src/__integrations__/__snapshots__/Email.integration.js.snap index d7de4e355..86b41c44f 100644 --- a/electron_app/src/__integrations__/__snapshots__/Email.integration.js.snap +++ b/electron_app/src/__integrations__/__snapshots__/Email.integration.js.snap @@ -15,7 +15,6 @@ Array [ "labels": "3", "matchedContacts": "from", "maxDate": "2018-06-15 08:23:19.120", - "minDate": "2018-06-14 08:23:19.120", "preview": "RE: Hello there", "recipientContactIds": "2,1", "s3Key": "s3KeyD", @@ -46,7 +45,6 @@ Array [ "labels": "1", "matchedContacts": "from", "maxDate": "2018-06-15 08:23:19.120", - "minDate": "2018-06-14 08:23:19.120", "preview": "RE: Hello there", "recipientContactIds": "2,1", "s3Key": "s3KeyD", @@ -72,7 +70,6 @@ Array [ "labels": null, "matchedContacts": "from", "maxDate": "2013-10-07 08:23:19.120", - "minDate": "2013-10-07 08:23:19.120", "preview": "Hello there", "recipientContactIds": "1", "s3Key": "s3KeyB", diff --git a/email_mailbox/public/threads.json b/email_mailbox/public/threads.json index 2b8ea96b9..156c4a6ea 100644 --- a/email_mailbox/public/threads.json +++ b/email_mailbox/public/threads.json @@ -9,7 +9,6 @@ "preview":"v3m cNvAeKiY1EakWwnfTvLdO22YzkuS7bILjnWncQCwqHBHWfYNsQekd4A3", "subject":"v3m cNvAeKiY1EakWwnfTvLdO22YzkuS7bILjnWncQCwqHBHWfYNsQekd4A3", "date": "2018-09-10 16:13:30", - "minDate": "2018-09-10 16:13:30", "status":0, "unread":1, "secure":1, @@ -30,7 +29,6 @@ "preview":"Jq pUgbu1A0gywTYTeKuWfyfCNGgvWKnAK6SHx0ur 7qcMH3PU5S7ESoLTA3", "subject":"Jq pUgbu1A0gywTYTeKuWfyfCNGgvWKnAK6SHx0ur 7qcMH3PU5S7ESoLTA3", "date": "2018-09-10 16:23:30", - "minDate": "2018-09-10 16:23:30", "status":0, "unread":1, "secure":1, @@ -52,7 +50,6 @@ "preview":"Jqm pUgbu1A0gywTYTeKuWfyfCNGgvWKnAK6SHx0ur 7qcMH3PU5S7ESoLTA3", "subject":"Jqm pUgbu1A0gywTYTeKuWfyfCNGgvWKnAK6SHx0ur 7qcMH3PU5S7ESoLTA3", "date": "2018-10-10 16:13:30", - "minDate": "2018-10-10 16:13:30", "status":0, "unread":1, "secure":1, diff --git a/email_mailbox/src/components/ThreadsWrapper.js b/email_mailbox/src/components/ThreadsWrapper.js index f5b2ca67d..fe7025fcc 100644 --- a/email_mailbox/src/components/ThreadsWrapper.js +++ b/email_mailbox/src/components/ThreadsWrapper.js @@ -94,7 +94,7 @@ class ThreadsWrapper extends Component { const lastThread = this.props.threads.last(); if (scrollTop + height > scrollHeight - SCROLL_BOTTOM_LIMIT && lastThread) { - const date = lastThread.get('minDate'); + const date = lastThread.get('maxDate'); if (this.state.lastMinDate !== date) { this.setState({ lastMinDate: date }, () => { this.props.onLoadThreads( diff --git a/email_mailbox/src/containers/ThreadItem.js b/email_mailbox/src/containers/ThreadItem.js index 5571d268a..e9deb6c4b 100644 --- a/email_mailbox/src/containers/ThreadItem.js +++ b/email_mailbox/src/containers/ThreadItem.js @@ -124,19 +124,19 @@ const mapDispatchToProps = (dispatch, ownProps) => { case LabelType.allmail.id: { const { allLabels } = thread; const draftLabelId = LabelType.draft.id; - const inboxLabelId = LabelType.inbox.id; - if (allLabels.includes(draftLabelId)) { + if (ownProps.mailbox === 'search') { + ownProps.onClickSelectedItem(type, { + ...params, + searchParams: ownProps.searchParams + }); + } else if (allLabels.includes(draftLabelId)) { openEmailInComposer({ key: thread.key, type: composerEvents.EDIT_DRAFT }); - break; - } - if (allLabels.includes(inboxLabelId)) { + } else { ownProps.onClickSelectedItem(type, params); - break; } - ownProps.onClickSelectedItem(type, params); break; } default: { diff --git a/email_mailbox/src/reducers/__tests__/__snapshots__/threads.js.snap b/email_mailbox/src/reducers/__tests__/__snapshots__/threads.js.snap index cd1cf12a1..9342e3808 100644 --- a/email_mailbox/src/reducers/__tests__/__snapshots__/threads.js.snap +++ b/email_mailbox/src/reducers/__tests__/__snapshots__/threads.js.snap @@ -9,7 +9,6 @@ Immutable.List [ 3, 4, ], - minDate: "2018-09-10 16:13:30", fromContactName: Immutable.List [ "User a", ], @@ -44,7 +43,6 @@ Immutable.List [ allLabels: Immutable.Set [ 5, ], - minDate: "2018-09-10 16:23:30", fromContactName: Immutable.List [ "User a", ],