File tree Expand file tree Collapse file tree 3 files changed +24
-6
lines changed Expand file tree Collapse file tree 3 files changed +24
-6
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @viamrobotics/svelte-sdk ' : minor
3+ ---
4+
5+ Set retry defaults
Original file line number Diff line number Diff line change @@ -74,6 +74,9 @@ export const provideRobotClientsContext = (
7474 } ;
7575 }
7676
77+ config . reconnectMaxAttempts ??= 1e9 ;
78+ config . reconnectMaxWait ??= 2000 ;
79+
7780 const client = await createRobotClient ( config ) ;
7881 ( client as RobotClient & { partID : string } ) . partID = partID ;
7982 client . on ( 'connectionstatechange' , ( event ) => {
Original file line number Diff line number Diff line change @@ -10,16 +10,26 @@ interface Props {
1010 children: Snippet ;
1111}
1212
13- let dialConfigs = $state (configs );
14-
15- $effect (() => {
16- const id = setInterval (() => (dialConfigs = { ... dialConfigs }), 3000 );
17- return () => clearInterval (id );
18- });
13+ let enabled = $state <Record <string , boolean >>({});
14+ let dialConfigs = $derived (
15+ Object .fromEntries (Object .entries (configs ).filter (([key ]) => enabled [key ]))
16+ );
1917
2018let { children }: Props = $props ();
2119 </script >
2220
21+ <div class =" flex gap-4 p-4" >
22+ {#each Object .keys (configs ) as part (part )}
23+ <div >
24+ <input
25+ type =" checkbox"
26+ bind:checked ={enabled [part ]}
27+ />
28+ {part }
29+ </div >
30+ {/each }
31+ </div >
32+
2333<ViamProvider {dialConfigs }>
2434 <Parts />
2535 {@render children ()}
You can’t perform that action at this time.
0 commit comments