mirror of
https://github.com/ansible/awx.git
synced 2026-05-12 03:47:36 -02:30
Only reload details whe navigating to details from another tab
This commit is contained in:
@@ -43,13 +43,10 @@ class Organization extends Component {
|
|||||||
async componentDidUpdate(prevProps) {
|
async componentDidUpdate(prevProps) {
|
||||||
const { location, match } = this.props;
|
const { location, match } = this.props;
|
||||||
const url = `/organizations/${match.params.id}/`;
|
const url = `/organizations/${match.params.id}/`;
|
||||||
const tabs = ['details', 'access', 'teams', 'notifications', 'edit'].map(
|
|
||||||
tab => `${url}${tab}`
|
|
||||||
);
|
|
||||||
const didNavigateFromTab = tabs.includes(prevProps.location.pathname);
|
|
||||||
if (
|
if (
|
||||||
|
prevProps.location.pathname.startsWith(url) &&
|
||||||
prevProps.location !== location &&
|
prevProps.location !== location &&
|
||||||
didNavigateFromTab &&
|
|
||||||
location.pathname === `${url}details`
|
location.pathname === `${url}details`
|
||||||
) {
|
) {
|
||||||
await this.loadOrganization();
|
await this.loadOrganization();
|
||||||
|
|||||||
Reference in New Issue
Block a user