mirror of
https://github.com/strapi/strapi.git
synced 2025-08-08 00:37:38 +00:00
parent
b3be6dea99
commit
99dfd24eaf
@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useMemo, useState } from 'react';
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { Prompt, useHistory, useLocation } from 'react-router-dom';
|
||||
import PropTypes from 'prop-types';
|
||||
import { get, has, isEqual } from 'lodash';
|
||||
@ -255,7 +255,7 @@ const ListView = () => {
|
||||
handleClickAddField(forTarget, targetUid, headerDisplayObject);
|
||||
},
|
||||
};
|
||||
const goToCMSettingsPage = () => {
|
||||
const goToCMSettingsPage = useCallback(() => {
|
||||
const endPoint = isInContentTypeView
|
||||
? `/plugins/content-manager/${contentTypeKind}/${targetUid}/ctm-configurations/edit-settings/content-types`
|
||||
: `/plugins/content-manager/ctm-configurations/edit-settings/components/${targetUid}/`;
|
||||
@ -263,7 +263,7 @@ const ListView = () => {
|
||||
if (!isTemporary) {
|
||||
push(endPoint);
|
||||
}
|
||||
};
|
||||
}, [contentTypeKind, isInContentTypeView, isTemporary, push, targetUid]);
|
||||
|
||||
const listInjectedComponents = useMemo(() => {
|
||||
return getComponents('listView', 'list.link', plugins, {
|
||||
@ -272,8 +272,7 @@ const ListView = () => {
|
||||
isInContentTypeView,
|
||||
contentTypeKind,
|
||||
});
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [isTemporary, isInContentTypeView, contentTypeKind]);
|
||||
}, [plugins, goToCMSettingsPage, isTemporary, isInContentTypeView, contentTypeKind]);
|
||||
|
||||
const listActions = isInDevelopmentMode
|
||||
? [...listInjectedComponents, <ListButton {...addButtonProps} key="add-button" />]
|
||||
|
Loading…
x
Reference in New Issue
Block a user