diff --git a/packages/app-backend-core/src/timeline-marker.ts b/packages/app-backend-core/src/timeline-marker.ts
index 95546fd82..8ac048e27 100644
--- a/packages/app-backend-core/src/timeline-marker.ts
+++ b/packages/app-backend-core/src/timeline-marker.ts
@@ -1,10 +1,13 @@
import type { BackendContext, TimelineMarker } from '@vue-devtools/app-backend-api'
-import { BridgeEvents } from '@vue-devtools/shared-utils'
+import { BridgeEvents, SharedData } from '@vue-devtools/shared-utils'
import type { TimelineMarkerOptions } from '@vue/devtools-api'
import { isPerformanceSupported } from '@vue/devtools-api'
import { dateThreshold, perfTimeDiff } from './timeline'
export async function addTimelineMarker(options: TimelineMarkerOptions, ctx: BackendContext) {
+ if (!SharedData.timelineRecording) {
+ return
+ }
if (!ctx.currentAppRecord) {
options.all = true
}
@@ -20,6 +23,9 @@ export async function addTimelineMarker(options: TimelineMarkerOptions, ctx: Bac
}
export async function sendTimelineMarkers(ctx: BackendContext) {
+ if (!SharedData.timelineRecording) {
+ return
+ }
if (!ctx.currentAppRecord) {
return
}
diff --git a/packages/app-backend-core/src/timeline.ts b/packages/app-backend-core/src/timeline.ts
index 3d8fcbba8..b67b58eeb 100644
--- a/packages/app-backend-core/src/timeline.ts
+++ b/packages/app-backend-core/src/timeline.ts
@@ -138,6 +138,9 @@ export async function sendTimelineLayers(ctx: BackendContext) {
}
export async function addTimelineEvent(options: TimelineEventOptions, app: App, ctx: BackendContext) {
+ if (!SharedData.timelineRecording) {
+ return
+ }
const appId = app ? getAppRecordId(app) : null
const isAllApps = options.all || !app || appId == null
@@ -195,6 +198,9 @@ export async function clearTimeline(ctx: BackendContext) {
}
export async function sendTimelineEventData(id: ID, ctx: BackendContext) {
+ if (!SharedData.timelineRecording) {
+ return
+ }
let data = null
const eventData = ctx.timelineEventMap.get(id)
if (eventData) {
@@ -224,6 +230,9 @@ export function removeLayersForApp(app: App, ctx: BackendContext) {
}
export function sendTimelineLayerEvents(appId: string, layerId: string, ctx: BackendContext) {
+ if (!SharedData.timelineRecording) {
+ return
+ }
const app = ctx.appRecords.find(ar => ar.id === appId)?.options.app
if (!app) {
return
diff --git a/packages/app-frontend/src/features/timeline/Timeline.vue b/packages/app-frontend/src/features/timeline/Timeline.vue
index 64781441c..81f5b32f3 100644
--- a/packages/app-frontend/src/features/timeline/Timeline.vue
+++ b/packages/app-frontend/src/features/timeline/Timeline.vue
@@ -415,6 +415,18 @@ export default defineComponent({
+