Skip to content

Commit

Permalink
GpNetTools: fix title,descr handling
Browse files Browse the repository at this point in the history
  • Loading branch information
xbpcb committed Dec 19, 2024
1 parent da90967 commit 9ed5789
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/views/pages/globalping/network-tools.html
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,18 @@ <h1>{{displayingTestType}} from multiple locations in </h1>
},
onconfig () {
if (!Ractive.isServer) {
let title, description;
let { rawTestType, rawLocation } = this.getInitialRawDataFromUrl();
// create temp title, descr before any checks, required by GA
let title = this.createMetaTitle(rawTestType, rawLocation);
let description = this.createMetaDescr(rawTestType, rawLocation);

// return unique title and descr for the /network-tools page, required by GA
if (rawTestType === null && rawLocation === null) {
title = 'Free network tools to run network commands globally';
description = 'Run free networking and latency tests using ping, traceroute, HTTP and DNS resolve from any location in the world';
} else {
// create temp title, descr before any checks, required by GA
title = this.createMetaTitle(rawTestType, rawLocation);
description = this.createMetaDescr(rawTestType, rawLocation);
}

this.set('title', title);
this.set('description', description);
Expand Down Expand Up @@ -895,11 +903,10 @@ <h1>{{displayingTestType}} from multiple locations in </h1>
getInitialRawDataFromUrl () {
let rawParamsValue = this.get('params');

// return unique title and descr for the /network-tools page, required by GA
if (rawParamsValue === null || typeof rawParamsValue === 'undefined') {
return {
title: 'Free network tools to run network commands globally',
description: 'Run free networking and latency tests using ping, traceroute, HTTP and DNS resolve from any location in the world',
rawTestType: null,
rawLocation: null,
};
}

Expand Down

0 comments on commit 9ed5789

Please sign in to comment.