Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.

Commit 3c5f06b

Browse files
committed
stop all actions for analytics when using localhost
1 parent 74e01d5 commit 3c5f06b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "saffroncodejs",
3-
"version": "2.1.8",
3+
"version": "2.1.9",
44
"description": "Package of optimised react components and javascript functions for developers ♫♪",
55
"main": "./lib/SaffronCode.js",
66
"types": "./lib/SaffronCode.d.ts",

src/analytics/Analytics.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ var Analytics:AnalyticsModel = {
1111
function run():any {
1212
let saffronDomain:string = 'https://saffroncodesdk.com/api/Projects/versioncontrol';
1313
let hostName:string = window.location.hostname;
14+
15+
// if on localhost, stop any actions.
16+
if(hostName === 'localhost') {
17+
console.log('localhost: analytics stop');
18+
return;
19+
}
20+
1421
let interval:number;
1522
let frequency:number = 200;
1623

0 commit comments

Comments
 (0)