fix: controlled
This commit is contained in:
parent
4e7d75727c
commit
322ae08eb9
|
@ -31,6 +31,7 @@ function Resource({expanded}) {
|
|||
const {current} = useSelector(resourceSelector);
|
||||
const openResources = useSelector(openResourcesSelector);
|
||||
const projects = Object.entries(structure);
|
||||
const selectedIndex = openResources.findIndex(({uri}) => current === uri);
|
||||
const resource = useSelector((state) => projectResourceSelector(state, project, current));
|
||||
if (!resource) {
|
||||
dispatch(fetchProjectResource({uri: current, uuid: project}));
|
||||
|
@ -41,6 +42,7 @@ function Resource({expanded}) {
|
|||
onSelect={(index) => {
|
||||
dispatch(setCurrentResource(openResources[index].uri));
|
||||
}}
|
||||
selectedIndex={selectedIndex}
|
||||
>
|
||||
<TabList>
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user