fix(views): Fix view tracking

This commit is contained in:
Stuart Taylor
2018-08-03 15:40:55 +01:00
committed by mrugesh mohapatra
parent ed7aa8f074
commit 993958daea

View File

@ -97,13 +97,13 @@ class ShowArticle extends Component {
if (username && !slug) { if (username && !slug) {
return history.push('/'); return history.push('/');
} }
if (article) {
const [, shortId] = slug.split('--'); const [, shortId] = slug.split('--');
postPopularityEvent({ postPopularityEvent({
event: 'view', event: 'view',
timestamp: Date.now(), timestamp: Date.now(),
shortId shortId
}); });
if (article) {
/* eslint-disable react/no-did-mount-set-state */ /* eslint-disable react/no-did-mount-set-state */
return this.setState( return this.setState(
{ {