Skip to content

Commit c307c30

Browse files
authored
fix(hub-ui): select a visible dock on standalone startup (#377)
1 parent bda5bc0 commit c307c30

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

packages/hub-ui/src/client/components/dock/DockStandalone.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,16 @@ const isRpcTrusted = useIsRpcTrusted(context, (isTrusted) => {
2929
}
3030
})
3131
32+
/** Select from the visible dock rail through normal activation, including client scripts and group routing. */
3233
watch(
33-
() => context.docks.entries,
34-
() => {
35-
context.docks.selectedId ||= context.docks.entries[0]?.id ?? null
34+
[() => context.docks.groupedEntries, isRpcTrusted],
35+
([groups, trusted]) => {
36+
if (!trusted || context.docks.selectedId)
37+
return
38+
const entry = groups.flatMap(([, entries]) => entries)
39+
.find(entry => entry.type !== 'action' && entry.type !== '~builtin')
40+
if (entry)
41+
void context.docks.switchEntry(entry.id)
3642
},
3743
{ immediate: true },
3844
)

0 commit comments

Comments
 (0)