From 7973a29ac21a3019451d04a4e3cf3a08befc523c Mon Sep 17 00:00:00 2001 From: Shaochuan Luo Date: Thu, 25 May 2023 10:43:34 +0800 Subject: [PATCH] fix(backends): ensure currentAppRecord is defined when backend handling components events emitted from Vue. (fix #1770) --- packages/app-backend-core/src/app.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/app-backend-core/src/app.ts b/packages/app-backend-core/src/app.ts index 18fc69635..d2f25dbd3 100644 --- a/packages/app-backend-core/src/app.ts +++ b/packages/app-backend-core/src/app.ts @@ -97,16 +97,16 @@ async function createAppRecord (options: AppRecordOptions, backend: DevtoolsBack appRecord: mapAppRecord(record), }) + // Auto select first app + if (ctx.currentAppRecord == null) { + await selectApp(record, ctx) + } + if (appRecordPromises.has(options.app)) { for (const r of appRecordPromises.get(options.app)) { await r(record) } } - - // Auto select first app - if (ctx.currentAppRecord == null) { - await selectApp(record, ctx) - } } else if (SharedData.debugInfo) { console.warn('[Vue devtools] No root instance found for app, it might have been unmounted', options.app) }