mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 04:13:30 +03:00
🐛 Fixed link click counts for duplicate links (#15789)
refs https://github.com/TryGhost/Team/issues/2213 When an email contains multiple links to the same destination, that link is only shown once on the analytics page. The total displayed count is not summed correctly.
This commit is contained in:
parent
a5c4091620
commit
c2dfb2b579
@ -171,7 +171,14 @@ export default class Analytics extends Component {
|
||||
if (!acc[link.link.title]) {
|
||||
acc[link.link.title] = link;
|
||||
} else {
|
||||
acc[link.link.title].clicks += link.clicks;
|
||||
if (!acc[link.link.title].count) {
|
||||
acc[link.link.title].count = {clicks: 0};
|
||||
}
|
||||
if (!acc[link.link.title].count.clicks) {
|
||||
acc[link.link.title].count.clicks = 0;
|
||||
}
|
||||
|
||||
acc[link.link.title].count.clicks += (link.count?.clicks ?? 0);
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
|
Loading…
Reference in New Issue
Block a user