refactor(telemetry): drop plugin_loaded capture from plugin entry
This commit is contained in:
@@ -8,7 +8,6 @@ import { writeFileAtomically } from "./write-file-atomically"
|
||||
|
||||
type PostHogActivityState = {
|
||||
lastActiveDayUTC?: string
|
||||
lastPluginLoadedDayUTC?: string
|
||||
}
|
||||
|
||||
type PostHogActivityCaptureState = {
|
||||
@@ -16,11 +15,6 @@ type PostHogActivityCaptureState = {
|
||||
captureDaily: boolean
|
||||
}
|
||||
|
||||
type PluginLoadedCaptureState = {
|
||||
dayUTC: string
|
||||
capturePluginLoaded: boolean
|
||||
}
|
||||
|
||||
const POSTHOG_ACTIVITY_STATE_FILE = "posthog-activity.json"
|
||||
|
||||
function getPostHogActivityStateFilePath(): string {
|
||||
@@ -89,22 +83,3 @@ export function getPostHogActivityCaptureState(now: Date = new Date()): PostHogA
|
||||
captureDaily,
|
||||
}
|
||||
}
|
||||
|
||||
export function getPluginLoadedCaptureState(now: Date = new Date()): PluginLoadedCaptureState {
|
||||
const state = readPostHogActivityState()
|
||||
const dayUTC = getUtcDayString(now)
|
||||
|
||||
const capturePluginLoaded = state.lastPluginLoadedDayUTC !== dayUTC
|
||||
|
||||
if (capturePluginLoaded) {
|
||||
writePostHogActivityState({
|
||||
...state,
|
||||
lastPluginLoadedDayUTC: dayUTC,
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
dayUTC,
|
||||
capturePluginLoaded,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user