File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -256,7 +256,7 @@ const CommandPalette: React.FC<CommandPaletteProps> = ({
256256 ) ,
257257 action : ( ) => {
258258 onCollectionSelect ?.( col . name ) ;
259- if ( explorerHref ) navigate ( explorerHref ) ;
259+ if ( explorerHref ) navigate ( explorerHref , { state : { initialCollection : col . name } } ) ;
260260 } ,
261261 } ) ;
262262 } ) ;
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ interface LocationState {
1010 accountName ?: string ;
1111 availableDbs ?: DbInfo [ ] ;
1212 availableAccounts ?: CosmosDBAccount [ ] ;
13+ initialCollection ?: string ;
1314}
1415
1516const DataExplorerPageWrapper : React . FC = ( ) => {
@@ -24,7 +25,9 @@ const DataExplorerPageWrapper: React.FC = () => {
2425
2526 const [ loading , setLoading ] = useState ( true ) ;
2627 const [ error , setError ] = useState < string | null > ( null ) ;
27- const [ activeCollection , setActiveCollection ] = useState < string | undefined > ( undefined ) ;
28+ const [ activeCollection , setActiveCollection ] = useState < string | undefined > (
29+ ( location . state as LocationState ) ?. initialCollection
30+ ) ;
2831
2932 // Used to keep sidebar populated during the async load so there's no visual flash
3033 const [ sessionCache ] = useState < { accountName ?: string ; collections ?: CollectionSummary [ ] ; availableAccounts ?: CosmosDBAccount [ ] ; availableDbs ?: DbInfo [ ] } | null > ( ( ) => {
You can’t perform that action at this time.
0 commit comments