diff --git a/frontend/web/components/pages/FeaturesPage.js b/frontend/web/components/pages/FeaturesPage.js index 545166ff5d7c..7036490002a7 100644 --- a/frontend/web/components/pages/FeaturesPage.js +++ b/frontend/web/components/pages/FeaturesPage.js @@ -30,6 +30,7 @@ const FeaturesPage = class extends Component { constructor(props, context) { super(props, context) this.state = { + loadedOnce: false, search: null, showArchived: false, sort: { label: 'Name', sortBy: 'name', sortOrder: 'asc' }, @@ -61,6 +62,7 @@ const FeaturesPage = class extends Component { params.environmentId !== oldParams.environmentId || params.projectId !== oldParams.projectId ) { + this.state.loadedOnce = false AppActions.getFeatures( params.projectId, params.environmentId, @@ -181,6 +183,9 @@ const FeaturesPage = class extends Component { totalFeatures, maxFeaturesAllowed, ) + if (projectFlags?.length && !this.state.loadedOnce) { + this.state.loadedOnce = true + } return (
{isLoading && (!projectFlags || !projectFlags.length) && ( @@ -188,9 +193,9 @@ const FeaturesPage = class extends Component {
)} - {(!isLoading || (projectFlags && !!projectFlags.length)) && ( + {(!isLoading || this.state.loadedOnce) && (
- {(projectFlags && projectFlags.length) || + {this.state.loadedOnce || ((this.state.showArchived || typeof this.state.search === 'string' || !!this.state.tags.length) && @@ -205,7 +210,7 @@ const FeaturesPage = class extends Component { title={'Features'} cta={ <> - {(projectFlags && projectFlags.length) || + {this.state.loadedOnce || this.state.showArchived || this.state.tags?.length ? this.createFeaturePermission((perm) => ( @@ -483,9 +488,7 @@ const FeaturesPage = class extends Component { title='2: Initialising your project' snippets={Constants.codeHelp.INIT( this.props.match.params.environmentId, - projectFlags && - projectFlags[0] && - projectFlags[0].name, + projectFlags?.[0]?.name, )} />