diff --git a/electron_app/package.json b/electron_app/package.json
index ff811ddac..f64d21a33 100644
--- a/electron_app/package.json
+++ b/electron_app/package.json
@@ -1,6 +1,6 @@
{
"name": "criptext",
- "version": "0.17.14",
+ "version": "0.17.15",
"author": {
"name": "Criptext Inc",
"email": "support@criptext.com",
diff --git a/email_mailbox/package.json b/email_mailbox/package.json
index af47338a4..a50ffacfc 100644
--- a/email_mailbox/package.json
+++ b/email_mailbox/package.json
@@ -1,6 +1,6 @@
{
"name": "email_mailbox",
- "version": "0.17.14",
+ "version": "0.17.15",
"private": true,
"dependencies": {
"@criptext/electron-better-ipc": "^0.1.2-rc5",
diff --git a/email_mailbox/src/actions/emails.js b/email_mailbox/src/actions/emails.js
index 973a0391e..b097286fd 100644
--- a/email_mailbox/src/actions/emails.js
+++ b/email_mailbox/src/actions/emails.js
@@ -16,7 +16,8 @@ import {
addContacts,
addFiles,
unsendEmailFiles,
- updateEmailIdsThread
+ updateEmailIdsThread,
+ updateThreadsSuccess
} from './index';
import { EmailStatus, SocketCommand } from '../utils/const';
import {
@@ -48,11 +49,11 @@ export const muteNotifications = emailId => {
};
};
-export const markEmailUnreadSuccess = (emailId, unreadValue) => {
+export const markEmailUnreadSuccess = (emailId, unread) => {
return {
type: Email.MARK_UNREAD,
emailId,
- unread: unreadValue
+ unread
};
};
@@ -110,11 +111,12 @@ export const muteEmail = (emailId, valueToSet) => {
};
};
-export const markEmailUnread = (emailId, valueToSet) => {
+export const markEmailUnread = (labelId, threadId, emailId, valueToSet) => {
return async dispatch => {
try {
await updateEmail({ id: emailId, unread: !!valueToSet });
dispatch(markEmailUnreadSuccess(emailId, valueToSet));
+ dispatch(updateThreadsSuccess(labelId, [threadId], valueToSet));
} catch (e) {
// To do
}
diff --git a/email_mailbox/src/components/Email.js b/email_mailbox/src/components/Email.js
index abc37ce7f..c903aff34 100644
--- a/email_mailbox/src/components/Email.js
+++ b/email_mailbox/src/components/Email.js
@@ -170,6 +170,7 @@ const renderEmailInfoExpand = props => (
onReplyAll={props.onReplyAll}
onForward={props.onForward}
onMarkAsSpam={props.onMarkAsSpam}
+ onMarkUnread={props.onMarkUnread}
onDelete={props.onDelete}
onDeletePermanently={props.handleClickPermanentlyDeleteEmail}
onToggleMenu={props.onTogglePopOverEmailActions}
@@ -184,10 +185,14 @@ const renderEmailInfoExpand = props => (
);
const showContacts = contacts => {
- return contacts.reduce(
- (result, contact) => `${result} ${contact.name || contact.email}`,
- ''
- );
+ return contacts.reduce((result, contact, index) => {
+ if (contacts.length > 1) {
+ const name = contact.name || contact.email;
+ const firstname = `${index !== 0 ? ', ' : ''}${name.split(' ')[0]}`;
+ return `${result}${firstname}`;
+ }
+ return `${result} ${contact.name || contact.email}`;
+ }, '');
};
const renderEmailStatus = status => {
@@ -269,6 +274,7 @@ renderEmailInfoExpand.propTypes = {
onDeletePermanently: PropTypes.func,
onForward: PropTypes.func,
onMarkAsSpam: PropTypes.func,
+ onMarkUnread: PropTypes.func,
onOpenEmailSource: PropTypes.func,
onPrintEmail: PropTypes.func,
onReplyEmail: PropTypes.func,
diff --git a/email_mailbox/src/components/EmailActions.js b/email_mailbox/src/components/EmailActions.js
index 2a1ed196c..fd417ca63 100644
--- a/email_mailbox/src/components/EmailActions.js
+++ b/email_mailbox/src/components/EmailActions.js
@@ -51,7 +51,12 @@ const EmailActions = props => {
)}
-
+ {
+ props.onMarkUnread(ev);
+ props.onToggleMenu(ev);
+ }}
+ >
{string.mailbox.mark_as_unread}
{!props.isSpam && (
@@ -95,6 +100,7 @@ EmailActions.propTypes = {
onDeletePermanently: PropTypes.func,
onForward: PropTypes.func,
onMarkAsSpam: PropTypes.func,
+ onMarkUnread: PropTypes.func,
onOpenEmailSource: PropTypes.func,
onPrintEmail: PropTypes.func,
onReplyAll: PropTypes.func,
diff --git a/email_mailbox/src/components/HeaderThreadOptions.js b/email_mailbox/src/components/HeaderThreadOptions.js
index b4da24c9d..187ffb6e2 100644
--- a/email_mailbox/src/components/HeaderThreadOptions.js
+++ b/email_mailbox/src/components/HeaderThreadOptions.js
@@ -95,8 +95,8 @@ class HeaderThreadOptions extends Component {
this.props.onClickMarkAsRead()}>
{markAsUnread
- ? string.mailbox.mark_as_read
- : string.mailbox.mark_as_unread}
+ ? string.mailbox.mark_as_unread
+ : string.mailbox.mark_as_read}
{!this.props.itemsChecked && (
diff --git a/email_mailbox/src/components/HeaderThreadOptionsWrapper.js b/email_mailbox/src/components/HeaderThreadOptionsWrapper.js
index 0ccc56999..3ac1a8f71 100644
--- a/email_mailbox/src/components/HeaderThreadOptionsWrapper.js
+++ b/email_mailbox/src/components/HeaderThreadOptionsWrapper.js
@@ -179,7 +179,7 @@ class HeaderThreadOptionsWrapper extends Component {
() => {
this.props.onMarkRead(
this.props.threadsSelected,
- !this.props.markAsUnread
+ this.props.markAsUnread
);
}
);
diff --git a/email_mailbox/src/components/settinggeneral.scss b/email_mailbox/src/components/settinggeneral.scss
index 5f351dadb..6771fc36d 100644
--- a/email_mailbox/src/components/settinggeneral.scss
+++ b/email_mailbox/src/components/settinggeneral.scss
@@ -87,13 +87,12 @@
}
#settings-general-usefullinks{
-.cptx-useful-link{
- color: #0091ff;
- font-size: 13px;
- font-weight: 400;
- margin-top: 7px;
- text-decoration: none;
-}
+ .cptx-useful-link{
+ color: #0091ff;
+ font-size: 13px;
+ font-weight: 400;
+ text-decoration: none;
+ }
}
/* THEME
diff --git a/email_mailbox/src/containers/Email.js b/email_mailbox/src/containers/Email.js
index 859c54fb5..1b301341a 100644
--- a/email_mailbox/src/containers/Email.js
+++ b/email_mailbox/src/containers/Email.js
@@ -19,10 +19,11 @@ import {
checkFileDownloaded
} from './../utils/ipc';
import {
+ markEmailUnread,
+ removeEmails,
unsendEmail,
updateEmailLabels,
- updateEmailOnSuccess,
- removeEmails
+ updateEmailOnSuccess
} from './../actions/index';
import {
EmailStatus,
@@ -180,6 +181,13 @@ const mapDispatchToProps = (dispatch, ownProps) => {
}
});
},
+ onMarkUnread: ev => {
+ ev.stopPropagation();
+ const labelId = ownProps.mailboxSelected.id;
+ dispatch(markEmailUnread(labelId, email.threadId, email.id, true)).then(
+ () => ownProps.onBackOption()
+ );
+ },
onOpenEmailSource: ev => {
ev.stopPropagation();
sendOpenEmailSource(email.key);
diff --git a/email_mailbox/src/containers/HeaderThreadOptions.js b/email_mailbox/src/containers/HeaderThreadOptions.js
index 8e8b3c15d..52e2b6364 100644
--- a/email_mailbox/src/containers/HeaderThreadOptions.js
+++ b/email_mailbox/src/containers/HeaderThreadOptions.js
@@ -37,7 +37,7 @@ const makeMapStateToProps = () => {
});
const labels = getLabelsIncluded(state, threadsLabelIds);
const markAsUnread = ownProps.itemsChecked
- ? shouldMarkAsUnread(threads, ownProps.itemsChecked)
+ ? !shouldMarkAsUnread(threads, ownProps.itemsChecked)
: true;
const allSelected = ownProps.itemsChecked
? threadIds.size === ownProps.itemsChecked.size
diff --git a/email_mailbox/src/utils/electronEventInterface.js b/email_mailbox/src/utils/electronEventInterface.js
index 242aa3c88..c4b9ad715 100644
--- a/email_mailbox/src/utils/electronEventInterface.js
+++ b/email_mailbox/src/utils/electronEventInterface.js
@@ -896,6 +896,7 @@ ipcRenderer.on(
case 'draft-edited': {
emitter.emit(Event.STORE_LOAD, {
labelIds: [LabelType.sent.id, LabelType.draft.id],
+ badgeLabelIds: [LabelType.draft.id],
threadIds: [threadId]
});
break;