Skip to content

Commit 7a6f2c2

Browse files
committed
perf(components): skip updates for non current apps
1 parent 5bf31c8 commit 7a6f2c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/app-backend-core/src/component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const MAX_$VM = 10
77
const $vmQueue = []
88

99
export async function sendComponentTreeData (appRecord: AppRecord, instanceId: string, filter = '', maxDepth: number = null, ctx: BackendContext) {
10-
if (!instanceId) return
10+
if (!instanceId || appRecord !== ctx.currentAppRecord) return
1111
const instance = getComponentInstance(appRecord, instanceId, ctx)
1212
if (!instance) {
1313
ctx.bridge.send(BridgeEvents.TO_FRONT_COMPONENT_TREE, {
@@ -29,7 +29,7 @@ export async function sendComponentTreeData (appRecord: AppRecord, instanceId: s
2929
}
3030

3131
export async function sendSelectedComponentData (appRecord: AppRecord, instanceId: string, ctx: BackendContext) {
32-
if (!instanceId) return
32+
if (!instanceId || appRecord !== ctx.currentAppRecord) return
3333
markSelectedInstance(instanceId, ctx)
3434
const instance = getComponentInstance(appRecord, instanceId, ctx)
3535
if (!instance) {

0 commit comments

Comments
 (0)