Skip to content

Commit fcedc43

Browse files
authored
fix: defer logs RPC call until client is authorized (#227)
1 parent b388411 commit fcedc43

File tree

1 file changed

+5
-2
lines changed
  • packages/core/src/client/webcomponents/state

1 file changed

+5
-2
lines changed

packages/core/src/client/webcomponents/state/logs.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,13 @@ export function useLogs(context: DocksContext): Reactive<LogsState> {
6262
context.rpc.client.register({
6363
name: 'devtoolskit:internal:logs:updated' satisfies keyof DevToolsRpcClientFunctions,
6464
type: 'action',
65-
handler: () => updateLogs(),
65+
handler: () => {
66+
if (context.rpc.isTrusted)
67+
updateLogs()
68+
},
6669
})
6770

68-
updateLogs()
71+
context.rpc.ensureTrusted().then(() => updateLogs())
6972
return state
7073
}
7174

0 commit comments

Comments
 (0)