fix "cannot read `size` of undefined" error message
This commit is contained in:
parent
eab41bd314
commit
d483f1ff16
|
@ -5,7 +5,9 @@ import { ModulePair } from 'src/routes/safe/store/models/safe'
|
|||
export const MODULES_TABLE_ADDRESS_ID = 'address'
|
||||
export const MODULES_TABLE_ACTIONS_ID = 'actions'
|
||||
|
||||
export const getModuleData = (modulesList: List<ModulePair>): List<{ [MODULES_TABLE_ADDRESS_ID]: ModulePair }> => {
|
||||
export const getModuleData = (
|
||||
modulesList: List<ModulePair> | null,
|
||||
): List<{ [MODULES_TABLE_ADDRESS_ID]: ModulePair }> | undefined => {
|
||||
return modulesList?.map((modules) => ({
|
||||
[MODULES_TABLE_ADDRESS_ID]: modules,
|
||||
}))
|
||||
|
|
|
@ -82,7 +82,7 @@ const Advanced = (): React.ReactElement => {
|
|||
const nonce = useSelector(safeNonceSelector)
|
||||
const granted = useSelector(grantedSelector)
|
||||
const modules = useSelector(safeModulesSelector)
|
||||
const moduleData = modules ?? getModuleData(modules)
|
||||
const moduleData = getModuleData(modules) ?? modules
|
||||
|
||||
const [viewRemoveModuleModal, setViewRemoveModuleModal] = React.useState(false)
|
||||
const hideRemoveModuleModal = () => setViewRemoveModuleModal(false)
|
||||
|
|
Loading…
Reference in New Issue