File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
packages/app-frontend/src/features/components Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ export default defineComponent({
27
27
subscribeToSelectedData ()
28
28
29
29
onMounted (() => {
30
+ requestComponentTree ()
30
31
selectLastComponent ()
31
32
})
32
33
Original file line number Diff line number Diff line change @@ -263,6 +263,8 @@ export function resetComponents () {
263
263
264
264
export const requestedComponentTree = new Set ( )
265
265
266
+ let requestComponentTreeRetryDelay = 500
267
+
266
268
export async function requestComponentTree ( instanceId : ComponentTreeNode [ 'id' ] = null ) {
267
269
if ( ! instanceId ) {
268
270
instanceId = '_root'
@@ -275,12 +277,32 @@ export async function requestComponentTree (instanceId: ComponentTreeNode['id']
275
277
276
278
await waitForAppSelect ( )
277
279
280
+ _sendTreeRequest ( instanceId )
281
+ _queueRetryTree ( instanceId )
282
+ }
283
+
284
+ function _sendTreeRequest ( instanceId : ComponentTreeNode [ 'id' ] ) {
278
285
getBridge ( ) . send ( BridgeEvents . TO_BACK_COMPONENT_TREE , {
279
286
instanceId,
280
287
filter : treeFilter . value ,
281
288
} )
282
289
}
283
290
291
+ function _queueRetryTree ( instanceId : ComponentTreeNode [ 'id' ] ) {
292
+ setTimeout ( ( ) => _retryRequestComponentTree ( instanceId ) , requestComponentTreeRetryDelay )
293
+ requestComponentTreeRetryDelay *= 1.5
294
+ }
295
+
296
+ function _retryRequestComponentTree ( instanceId : ComponentTreeNode [ 'id' ] ) {
297
+ if ( rootInstances . value . length ) {
298
+ requestComponentTreeRetryDelay = 500
299
+ return
300
+ }
301
+ console . log ( _retryRequestComponentTree )
302
+ _sendTreeRequest ( instanceId )
303
+ _queueRetryTree ( instanceId )
304
+ }
305
+
284
306
export function ensureComponentsMapData ( data : ComponentTreeNode ) {
285
307
let component = componentsMap . value [ data . id ]
286
308
if ( ! component ) {
You can’t perform that action at this time.
0 commit comments