Skip to content

Commit 6cf77e3

Browse files
author
Erika Perugachi
authored
Merge pull request #451 from erikaperugachi/composer
Fixes
2 parents fc73357 + 03647c1 commit 6cf77e3

File tree

6 files changed

+8
-17
lines changed

6 files changed

+8
-17
lines changed

electron_app/src/DBManager.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,6 @@ const baseThreadQuery = ({
658658
),
659659
db.raw(`GROUP_CONCAT(DISTINCT(${Table.FILE}.token)) as fileTokens`),
660660
db.raw(`MAX(${Table.EMAIL}.unread) as unread`),
661-
db.raw(`MIN(email.date) as minDate`),
662661
db.raw(`MAX(email.date) as maxDate`)
663662
)
664663
.from(Table.EMAIL)

electron_app/src/__integrations__/__snapshots__/Email.integration.js.snap

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Array [
1515
"labels": "3",
1616
"matchedContacts": "from",
1717
"maxDate": "2018-06-15 08:23:19.120",
18-
"minDate": "2018-06-14 08:23:19.120",
1918
"preview": "RE: Hello there",
2019
"recipientContactIds": "2,1",
2120
"s3Key": "s3KeyD",
@@ -46,7 +45,6 @@ Array [
4645
"labels": "1",
4746
"matchedContacts": "from",
4847
"maxDate": "2018-06-15 08:23:19.120",
49-
"minDate": "2018-06-14 08:23:19.120",
5048
"preview": "RE: Hello there",
5149
"recipientContactIds": "2,1",
5250
"s3Key": "s3KeyD",
@@ -72,7 +70,6 @@ Array [
7270
"labels": null,
7371
"matchedContacts": "from",
7472
"maxDate": "2013-10-07 08:23:19.120",
75-
"minDate": "2013-10-07 08:23:19.120",
7673
"preview": "Hello there",
7774
"recipientContactIds": "1",
7875
"s3Key": "s3KeyB",

email_mailbox/public/threads.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"preview":"v3m cNvAeKiY1EakWwnfTvLdO22YzkuS7bILjnWncQCwqHBHWfYNsQekd4A3",
1010
"subject":"v3m cNvAeKiY1EakWwnfTvLdO22YzkuS7bILjnWncQCwqHBHWfYNsQekd4A3",
1111
"date": "2018-09-10 16:13:30",
12-
"minDate": "2018-09-10 16:13:30",
1312
"status":0,
1413
"unread":1,
1514
"secure":1,
@@ -30,7 +29,6 @@
3029
"preview":"Jq pUgbu1A0gywTYTeKuWfyfCNGgvWKnAK6SHx0ur 7qcMH3PU5S7ESoLTA3",
3130
"subject":"Jq pUgbu1A0gywTYTeKuWfyfCNGgvWKnAK6SHx0ur 7qcMH3PU5S7ESoLTA3",
3231
"date": "2018-09-10 16:23:30",
33-
"minDate": "2018-09-10 16:23:30",
3432
"status":0,
3533
"unread":1,
3634
"secure":1,
@@ -52,7 +50,6 @@
5250
"preview":"Jqm pUgbu1A0gywTYTeKuWfyfCNGgvWKnAK6SHx0ur 7qcMH3PU5S7ESoLTA3",
5351
"subject":"Jqm pUgbu1A0gywTYTeKuWfyfCNGgvWKnAK6SHx0ur 7qcMH3PU5S7ESoLTA3",
5452
"date": "2018-10-10 16:13:30",
55-
"minDate": "2018-10-10 16:13:30",
5653
"status":0,
5754
"unread":1,
5855
"secure":1,

email_mailbox/src/components/ThreadsWrapper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class ThreadsWrapper extends Component {
9494
const lastThread = this.props.threads.last();
9595

9696
if (scrollTop + height > scrollHeight - SCROLL_BOTTOM_LIMIT && lastThread) {
97-
const date = lastThread.get('minDate');
97+
const date = lastThread.get('maxDate');
9898
if (this.state.lastMinDate !== date) {
9999
this.setState({ lastMinDate: date }, () => {
100100
this.props.onLoadThreads(

email_mailbox/src/containers/ThreadItem.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,19 +124,19 @@ const mapDispatchToProps = (dispatch, ownProps) => {
124124
case LabelType.allmail.id: {
125125
const { allLabels } = thread;
126126
const draftLabelId = LabelType.draft.id;
127-
const inboxLabelId = LabelType.inbox.id;
128-
if (allLabels.includes(draftLabelId)) {
127+
if (ownProps.mailbox === 'search') {
128+
ownProps.onClickSelectedItem(type, {
129+
...params,
130+
searchParams: ownProps.searchParams
131+
});
132+
} else if (allLabels.includes(draftLabelId)) {
129133
openEmailInComposer({
130134
key: thread.key,
131135
type: composerEvents.EDIT_DRAFT
132136
});
133-
break;
134-
}
135-
if (allLabels.includes(inboxLabelId)) {
137+
} else {
136138
ownProps.onClickSelectedItem(type, params);
137-
break;
138139
}
139-
ownProps.onClickSelectedItem(type, params);
140140
break;
141141
}
142142
default: {

email_mailbox/src/reducers/__tests__/__snapshots__/threads.js.snap

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Immutable.List [
99
3,
1010
4,
1111
],
12-
minDate: "2018-09-10 16:13:30",
1312
fromContactName: Immutable.List [
1413
"User a",
1514
],
@@ -44,7 +43,6 @@ Immutable.List [
4443
allLabels: Immutable.Set [
4544
5,
4645
],
47-
minDate: "2018-09-10 16:23:30",
4846
fromContactName: Immutable.List [
4947
"User a",
5048
],

0 commit comments

Comments
 (0)