Skip to content

Commit 4f9e6d7

Browse files
committed
fix: email preferences not loaded
1 parent 09c33e2 commit 4f9e6d7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/shared/actions/newsletterPreferences.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,17 @@ async function fetchDataDone(emailHash, listId = config.NEWSLETTER_SIGNUP.DEFAUL
3333
return result.json();
3434
});
3535

36+
let preferences = [];
37+
let status = 'notsubscribed';
38+
if (!error && subs.status === 'subscribed') {
39+
status = 'subscribed';
40+
preferences = subs.interests;
41+
}
42+
3643
return {
3744
email: emailHash,
38-
preferences: subs.interests,
39-
status: subs.status,
45+
preferences,
46+
status,
4047
error,
4148
};
4249
} catch (error) {

0 commit comments

Comments
 (0)