File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -225,11 +225,11 @@ export const setChannel = (
225225 setSelectedModules ( modulesToUpdate ) ;
226226} ;
227227
228- export const findIndexOfSelectedModule = (
228+ export const checkSelectedModule = (
229229 module : { name : string } ,
230230 layoutState : { midColumn : { resourceType : string } } ,
231231) => {
232- // Checking index for modules like btp-operator on refresh.
232+ // Checking if this is the selected module after a refresh or other case after which we have undefined .
233233 if ( window . location . href . includes ( 'kymamodules' ) && layoutState ?. midColumn ) {
234234 const resourceType = layoutState . midColumn . resourceType ;
235235 const resourceTypeDotIndex = resourceType . indexOf ( '.' ) ;
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ import {
2020} from 'components/KymaModules/kymaModulesQueries' ;
2121import { ModulesDeleteBox } from 'components/KymaModules/components/ModulesDeleteBox' ;
2222import { usePrepareLayoutColumns } from 'shared/hooks/usePrepareLayout' ;
23- import { findIndexOfSelectedModule } from 'components/KymaModules/support' ;
23+ import { checkSelectedModule } from 'components/KymaModules/support' ;
2424
2525const KymaModulesList = React . lazy ( ( ) =>
2626 import ( '../../components/KymaModules/KymaModulesList' ) ,
@@ -198,8 +198,9 @@ const ColumnWraper = ({
198198 selectedModules = { activeKymaModules }
199199 chosenModuleIndex = {
200200 openedModuleIndex ??
201+ // Find index of the selected module after a refresh or other case after which we have undefined.
201202 activeKymaModules . findIndex ( module =>
202- findIndexOfSelectedModule ( module , layoutState ) ,
203+ checkSelectedModule ( module , layoutState ) ,
203204 )
204205 }
205206 kymaResource = { kymaResource }
You can’t perform that action at this time.
0 commit comments