mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-09-01 21:32:35 +02:00
External redirect tracking from roadmap.sh
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
import { wireframeJSONToSVG } from 'roadmap-renderer';
|
import { wireframeJSONToSVG } from 'roadmap-renderer';
|
||||||
|
import { httpPost } from '../../lib/http';
|
||||||
|
import { isLoggedIn } from '../../lib/jwt';
|
||||||
import {
|
import {
|
||||||
renderResourceProgress,
|
renderResourceProgress,
|
||||||
ResourceType,
|
ResourceType,
|
||||||
} from '../../lib/resource-progress';
|
} from '../../lib/resource-progress';
|
||||||
import { isLoggedIn } from '../../lib/jwt';
|
|
||||||
import { httpPost } from '../../lib/http';
|
|
||||||
|
|
||||||
export class Renderer {
|
export class Renderer {
|
||||||
resourceId: string;
|
resourceId: string;
|
||||||
@@ -176,7 +176,17 @@ export class Renderer {
|
|||||||
e.stopImmediatePropagation();
|
e.stopImmediatePropagation();
|
||||||
|
|
||||||
if (/^ext_link/.test(groupId)) {
|
if (/^ext_link/.test(groupId)) {
|
||||||
window.open(`https://${groupId.replace('ext_link:', '')}`);
|
const externalLink = groupId.replace('ext_link:', '');
|
||||||
|
|
||||||
|
if (!externalLink.startsWith('roadmap.sh')) {
|
||||||
|
window.fireEvent({
|
||||||
|
category: 'RoadmapExternalLink',
|
||||||
|
action: `${this.resourceType} / ${this.resourceId}`,
|
||||||
|
label: externalLink,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
window.open(`https://${externalLink}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user