File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ const Dashboard: Component<RouteSectionProps> = () => {
114114 }
115115 } )
116116
117- const [ devices ] = createResource ( getDevices , { initialValue : [ ] } )
117+ const [ devices , { refetch } ] = createResource ( getDevices , { initialValue : [ ] } )
118118 const [ profile ] = createResource ( getProfile )
119119
120120 const getDefaultDongleId = ( ) => {
@@ -130,7 +130,7 @@ const Dashboard: Component<RouteSectionProps> = () => {
130130 < Drawer drawer = { < DashboardDrawer devices = { devices ( ) } /> } >
131131 < Switch fallback = { < TopAppBar leading = { < DrawerToggleButton /> } > No device</ TopAppBar > } >
132132 < Match when = { urlState ( ) . dongleId === 'pair' || ! ! location . query . pair } >
133- < PairActivity />
133+ < PairActivity onPaired = { refetch } />
134134 </ Match >
135135 < Match when = { urlState ( ) . dongleId } keyed >
136136 { ( dongleId ) => (
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import TopAppBar from '~/components/material/TopAppBar'
1111
1212import './PairActivity.css'
1313
14- const PairActivity : VoidComponent = ( ) => {
14+ const PairActivity : VoidComponent < { onPaired : ( ) => void } > = ( props ) => {
1515 const { pair } = useLocation ( ) . query
1616 const pairToken : string | undefined = Array . isArray ( pair ) ? pair [ 0 ] : pair
1717
@@ -79,6 +79,7 @@ const PairActivity: VoidComponent = () => {
7979
8080 pairDevice ( input . pairToken )
8181 . then ( ( dongleId ) => navigate ( `/${ dongleId } ` ) )
82+ . then ( props . onPaired )
8283 . catch ( ( reason ) => {
8384 let error : Error
8485 if ( reason instanceof Error ) {
You can’t perform that action at this time.
0 commit comments