Skip to content
Snippets Groups Projects
Commit 855255e5 authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

fix(fix unsubscribe from emails):

parent 847fc63b
No related branches found
No related tags found
1 merge request!14Sprint #15
......@@ -8,7 +8,7 @@ import {
import { Row, RowItem, LabelHeader, LinkText } from '../UIComponents/FormItems'
const EmailNotifications = ({ subscribed = '', subscribe, unsubscribe }) => (
const EmailNotifications = ({ subscribed, subscribe, unsubscribe }) => (
<Root>
<Row noMargin>
<RowItem>
......@@ -46,7 +46,7 @@ export default compose(
title: 'Subscribe to emails',
subtitle: 'Are you sure you want to subscribe to emails?',
onConfirm: () => {
changeEmailSubscription(userId, false)
changeEmailSubscription(userId, true)
hideModal()
},
onCancel: hideModal,
......@@ -62,7 +62,7 @@ export default compose(
title: 'Unsubscribe from emails',
subtitle: 'Are you sure you want to unsubscribe from emails?',
onConfirm: () => {
changeEmailSubscription(userId, true)
changeEmailSubscription(userId, false)
hideModal()
},
onCancel: hideModal,
......
......@@ -23,7 +23,7 @@ const UserProfilePage = ({ history, user, changeEmailSubscription }) => (
<AccountDetails history={history} user={user} />
<EmailNotifications
changeEmailSubscription={changeEmailSubscription}
subscribed={get(user, 'notifications.email.user')}
subscribed={get(user, 'notifications.email.user', true)}
userId={get(user, 'id')}
/>
<LinkOrcID id={get(user, 'id')} orcid={get(user, 'orcid')} />
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment