fix(views): Fix view tracking
This commit is contained in:
committed by
mrugesh mohapatra
parent
ed7aa8f074
commit
993958daea
@ -97,13 +97,13 @@ class ShowArticle extends Component {
|
|||||||
if (username && !slug) {
|
if (username && !slug) {
|
||||||
return history.push('/');
|
return history.push('/');
|
||||||
}
|
}
|
||||||
|
const [, shortId] = slug.split('--');
|
||||||
|
postPopularityEvent({
|
||||||
|
event: 'view',
|
||||||
|
timestamp: Date.now(),
|
||||||
|
shortId
|
||||||
|
});
|
||||||
if (article) {
|
if (article) {
|
||||||
const [, shortId] = slug.split('--');
|
|
||||||
postPopularityEvent({
|
|
||||||
event: 'view',
|
|
||||||
timestamp: Date.now(),
|
|
||||||
shortId
|
|
||||||
});
|
|
||||||
/* eslint-disable react/no-did-mount-set-state */
|
/* eslint-disable react/no-did-mount-set-state */
|
||||||
return this.setState(
|
return this.setState(
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user