Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
jribbink committed Dec 13, 2024
1 parent 7781eb5 commit a0b3d50
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
9 changes: 3 additions & 6 deletions helpers/telemetry/telemetry.client.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import Mixpanel from 'mixpanel-browser'
import { trackWalletConnected, trackWalletDiscoveryRequest } from './telemetry'
import { TelemetryConfigClient } from './types'
import { TelemetryDataClient } from './types'

let mixpanel: any = null

export function getTelemetryClient(
config: TelemetryConfigClient,
baseData: any,
) {
export function getTelemetryClient(baseData: TelemetryDataClient) {
if (process.env.NEXT_PUBLIC_MIXPANEL_ID && !mixpanel) {
mixpanel = Mixpanel.init(process.env.MIXPANEL_ID)
}

mixpanel.register(config)
mixpanel.register(baseData)

return {
trackWalletDiscoveryRequest: trackWalletDiscoveryRequest(
Expand Down
4 changes: 2 additions & 2 deletions helpers/telemetry/telemetry.server.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Mixpanel from 'mixpanel'
import { TelemetryConfigServer } from './types'
import { TelemetryDataServer } from './types'
import { trackWalletConnected, trackWalletDiscoveryRequest } from './telemetry'

let mixpanel: Mixpanel.Mixpanel | null = null

export function getTelemetryServer(baseData: TelemetryConfigServer) {
export function getTelemetryServer(baseData: TelemetryDataServer) {
if (process.env.MIXPANEL_ID && !mixpanel) {
mixpanel = Mixpanel.init(process.env.MIXPANEL_ID)
}
Expand Down
6 changes: 3 additions & 3 deletions helpers/telemetry/types.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export type TelemetryConfig = {
export type TelemetryData = {
fclVersion: string
type: 'UI' | 'API'
network: string
}

export type TelemetryConfigServer = TelemetryConfig & {
export type TelemetryDataServer = TelemetryData & {
origin?: string
}

export type TelemetryConfigClient = TelemetryConfig & {
export type TelemetryDataClient = TelemetryData & {
parent: string
}

0 comments on commit a0b3d50

Please sign in to comment.