Store last_announcement_seen dates per each WP user [MAILPOET-1627]

This commit is contained in:
wxa
2018-12-06 17:11:18 +03:00
parent 4a0f7aee47
commit 0f8a3b701c
2 changed files with 7 additions and 3 deletions

View File

@@ -38,11 +38,14 @@ class FeatureAnnouncement extends React.Component {
this.setState({ showDot: false });
MailPoet.Modal.loading(false);
window.Beamer.show();
const data = { last_announcement_seen: {} };
const userId = window.mailpoet_current_wp_user.ID;
data.last_announcement_seen[userId] = Math.floor(Date.now() / 1000);
MailPoet.Ajax.post({
api_version: window.mailpoet_api_version,
endpoint: 'settings',
action: 'set',
data: { last_announcement_seen: Math.floor(Date.now() / 1000) },
data,
});
}