Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions wing-console/console/app/src/analytics.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Analytics from "@segment/analytics-node";
// import Analytics from "@segment/analytics-node";

export interface CreateAnalyticsOptions {
anonymousId: string;
Expand All @@ -12,28 +12,28 @@ export interface IAnalytics {
export const createAnalytics = (
options: CreateAnalyticsOptions,
): IAnalytics => {
let segment: Analytics;
const sessionId = Date.now();
// let segment: Analytics;
// const sessionId = Date.now();
try {
segment = new Analytics({ writeKey: options.segmentWriteKey });
// segment = new Analytics({ writeKey: options.segmentWriteKey });
} catch {}
return {
track(event: string, properties?: Record<string, any>) {
if (!segment) {
return;
}
try {
segment.track({
anonymousId: options.anonymousId,
event: event.toLowerCase().replaceAll(/\s/g, ""),
properties,
integrations: {
"Actions Amplitude": {
session_id: sessionId,
},
},
});
} catch {}
// if (!segment) {
// return;
// }
// try {
// segment.track({
// anonymousId: options.anonymousId,
// event: event.toLowerCase().replaceAll(/\s/g, ""),
// properties,
// integrations: {
// "Actions Amplitude": {
// session_id: sessionId,
// },
// },
// });
// } catch {}
},
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { Hierarchy } from "../hierarchy-pane/hierarchy.js";
import { Inspector } from "../inspector-pane/inspector.js";
import { LogsWidget } from "../logs-pane/logs.js";
import { useSelectionContext } from "../selection-context/selection-context.js";
import { SignInModal } from "../sign-in/sign-in.js";
// import { SignInModal } from "../sign-in/sign-in.js";
import { StatusBar } from "../status-bar/status-bar.js";
import { TestTree } from "../tests-pane/test-tree.js";
import { WebSocketState } from "../websocket-state/websocket-state.js";
Expand Down Expand Up @@ -158,7 +158,7 @@ export const DefaultLayout = ({

return (
<>
<SignInModal />
{/* <SignInModal /> */}
<WebSocketState />

<div className={classNames("w-full h-full", theme.bg1)}>
Expand Down
Loading