@@ -25,7 +25,7 @@ import {
25
25
} from './component'
26
26
import { addQueuedPlugins , addPlugin , sendPluginList , addPreviouslyRegisteredPlugins } from './plugin'
27
27
import { PluginDescriptor , SetupFunction , TimelineLayerOptions , App , TimelineEventOptions , CustomInspectorOptions } from '@vue/devtools-api'
28
- import { registerApp , selectApp , mapAppRecord , getAppRecordId } from './app'
28
+ import { registerApp , selectApp , mapAppRecord , getAppRecordId , waitForAppsRegistration } from './app'
29
29
import { sendInspectorTree , getInspector , getInspectorWithAppId , sendInspectorState } from './inspector'
30
30
import { showScreenshot } from './timeline-screenshot'
31
31
@@ -55,11 +55,11 @@ export async function initBackend (bridge: Bridge) {
55
55
hook . once ( HookEvents . INIT , connect )
56
56
}
57
57
58
- hook . on ( HookEvents . APP_ADD , app => {
58
+ hook . on ( HookEvents . APP_ADD , async app => {
59
+ await registerApp ( app , ctx )
60
+
59
61
// Will init connect
60
62
hook . emit ( HookEvents . INIT )
61
-
62
- registerApp ( app , ctx )
63
63
} )
64
64
65
65
// In case we close and open devtools again
@@ -71,12 +71,16 @@ export async function initBackend (bridge: Bridge) {
71
71
}
72
72
}
73
73
74
- function connect ( ) {
74
+ async function connect ( ) {
75
75
if ( connected ) {
76
76
return
77
77
}
78
78
connected = true
79
79
80
+ await waitForAppsRegistration ( )
81
+
82
+ console . log ( '%cconnect' , 'color: blue;' )
83
+
80
84
ctx . currentTab = BuiltinTabs . COMPONENTS
81
85
82
86
// Subscriptions
0 commit comments