}
};
- fetchComponent = async (shouldRedirectToDashboard = false, backgroundLoading = false) => {
+ fetchComponent = async (shouldRedirectToDashboard = false) => {
const { branch, id: key, pullRequest } = this.props.location.query;
- if (!backgroundLoading) {
+ const { component } = this.state;
+
+ // Only show loader if we're changing components
+ if (component?.key !== key) {
this.setState({ loading: true });
}
},
() => {
if (shouldFetchComponent) {
- this.fetchComponent(shouldRedirectToDashboard, true);
+ this.fetchComponent(shouldRedirectToDashboard);
}
},
);