aboutsummaryrefslogtreecommitdiff
path: root/vnext/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-06-27 22:35:14 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:53 +0300
commit43ad3c12adc0372bebeef4cba26645811d1720af (patch)
tree89a094b805737c2ace05a161ae6c2a2edce6ea6e /vnext/src
parent01f1135df1bbf44217124e78850cf1e12911e01e (diff)
move tracking pixel url to api
Diffstat (limited to 'vnext/src')
-rw-r--r--vnext/src/api/index.js4
-rw-r--r--vnext/src/components/Thread.js5
2 files changed, 6 insertions, 3 deletions
diff --git a/vnext/src/api/index.js b/vnext/src/api/index.js
index 591f874a..00605d87 100644
--- a/vnext/src/api/index.js
+++ b/vnext/src/api/index.js
@@ -75,4 +75,8 @@ export function facebookLink() {
export function vkLink() {
return socialLink('vk');
+}
+
+export function markReadTracker(msg, visitor) {
+ return `${apiBaseUrl}/thread/mark_read/${msg.mid}-${msg.rid || 0}.gif?hash=${visitor.hash}`;
} \ No newline at end of file
diff --git a/vnext/src/components/Thread.js b/vnext/src/components/Thread.js
index b1e1abb3..df3f460a 100644
--- a/vnext/src/components/Thread.js
+++ b/vnext/src/components/Thread.js
@@ -1,6 +1,5 @@
import React from 'react';
import { Link } from 'react-router-dom';
-import * as qs from 'query-string';
import moment from 'moment';
import Message from './Message';
@@ -12,7 +11,7 @@ import Button from './Button';
import { format } from '../utils/embed';
-import { getMessages, comment } from '../api';
+import { getMessages, comment, markReadTracker } from '../api';
export default class Thread extends React.Component {
constructor(props) {
@@ -90,7 +89,7 @@ export default class Thread extends React.Component {
{
this.props.visitor.uid > 0 && msg.mid &&
<div className="title2">
- <img style={{ display: 'none' }} src={`https://api.juick.com/thread/mark_read/${msg.mid}-${msg.rid || 0}.gif?hash=${this.props.visitor.hash}`} />
+ <img style={{ display: 'none' }} src={markReadTracker(msg, this.props.visitor)} />
<h2>{msg.replies && `Replies (${msg.replies})`}</h2>
</div>
}