From d0b5fea8a13068dc391261984e1358dd63c72abf Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Sun, 4 Feb 2024 16:55:58 +0100 Subject: [PATCH] fix: only send data on update if it's current component --- packages/app-backend-core/src/component.ts | 2 +- packages/app-backend-core/src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/app-backend-core/src/component.ts b/packages/app-backend-core/src/component.ts index e402b5bb2..927fc170b 100644 --- a/packages/app-backend-core/src/component.ts +++ b/packages/app-backend-core/src/component.ts @@ -1,7 +1,7 @@ import { stringify, BridgeEvents, parse, SharedData } from '@vue-devtools/shared-utils' import { AppRecord, BackendContext, BuiltinBackendFeature } from '@vue-devtools/app-backend-api' import { getAppRecord } from './app' -import { App, ComponentInstance, EditStatePayload, now } from '@vue/devtools-api' +import { App, ComponentInstance, EditStatePayload } from '@vue/devtools-api' const MAX_$VM = 10 const $vmQueue = [] diff --git a/packages/app-backend-core/src/index.ts b/packages/app-backend-core/src/index.ts index 7fa699e70..b6c510fe0 100644 --- a/packages/app-backend-core/src/index.ts +++ b/packages/app-backend-core/src/index.ts @@ -121,7 +121,7 @@ async function connect () { const sendComponentUpdate = throttle(async (appRecord: AppRecord, id: string) => { try { // Update component inspector - if (ctx.currentInspectedComponentId) { + if (ctx.currentInspectedComponentId === id) { await sendSelectedComponentData(appRecord, ctx.currentInspectedComponentId, ctx) }