Skip to content

Commit 321d7ee

Browse files
committed
fix(apps): hidden apps were still sent
1 parent 7012ebd commit 321d7ee

File tree

1 file changed

+8
-4
lines changed
  • packages/app-backend-core/src

1 file changed

+8
-4
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,13 @@ async function createAppRecord (options: AppRecordOptions, backend: DevtoolsBack
8282

8383
await backend.api.registerApplication(options.app)
8484

85-
ctx.bridge.send(BridgeEvents.TO_FRONT_APP_ADD, {
86-
appRecord: mapAppRecord(record),
87-
})
85+
const isAppHidden = !!(await record.backend.api.getComponentDevtoolsOptions(record.rootInstance)).hide
86+
87+
if (!isAppHidden) {
88+
ctx.bridge.send(BridgeEvents.TO_FRONT_APP_ADD, {
89+
appRecord: mapAppRecord(record),
90+
})
91+
}
8892

8993
if (appRecordPromises.has(options.app)) {
9094
for (const r of appRecordPromises.get(options.app)) {
@@ -93,7 +97,7 @@ async function createAppRecord (options: AppRecordOptions, backend: DevtoolsBack
9397
}
9498

9599
// Auto select first app
96-
if (ctx.currentAppRecord == null && !(await record.backend.api.getComponentDevtoolsOptions(record.rootInstance)).hide) {
100+
if (ctx.currentAppRecord == null && !isAppHidden) {
97101
await selectApp(record, ctx)
98102
}
99103
} else {

0 commit comments

Comments
 (0)