From 7796a850b8a47165f89337f55033aee56b941fcb Mon Sep 17 00:00:00 2001 From: Alexander Zaslonov Date: Mon, 30 Nov 2020 16:40:15 -0800 Subject: [PATCH] Renamed AppInsightsLogger. Added local storage cleanup to website reset view. --- src/components/content/resetDetails.ts | 3 ++- src/logging/appInsightsLogger.ts | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/content/resetDetails.ts b/src/components/content/resetDetails.ts index e449037d2..f12c84364 100644 --- a/src/components/content/resetDetails.ts +++ b/src/components/content/resetDetails.ts @@ -29,7 +29,8 @@ export class ResetDetailsWorkshop { public async reset(): Promise { try { this.logger.trackEvent("Click: Reset website"); - + + localStorage.clear(); this.offlineObjectStorage.discardChanges(); this.viewManager.clearJourney(); this.viewManager.hideToolboxes(); diff --git a/src/logging/appInsightsLogger.ts b/src/logging/appInsightsLogger.ts index 13c14e70c..eb7b29e1a 100644 --- a/src/logging/appInsightsLogger.ts +++ b/src/logging/appInsightsLogger.ts @@ -3,13 +3,13 @@ import { Logger } from "@paperbits/common/logging"; import { AppInsights } from "applicationinsights-js"; -export class LogService implements Logger { +export class AppInsightsLogger implements Logger { constructor(private readonly instrumentationKey: string) { - if (this.instrumentationKey && location.hostname.endsWith(".net")) { + if (this.instrumentationKey) { AppInsights.downloadAndSetup({ instrumentationKey: this.instrumentationKey }); } else { - console.warn("AppInsights instrumentation key wasn't specified or cannot be used in current environment."); + console.warn("AppInsights instrumentation key wasn't specified."); } this.trackSession();