fix: Incorrect page list in deployed branches (#12416)

This commit is contained in:
arunvjn 2022-03-31 13:21:20 +05:30 committed by GitHub
parent a596d7101f
commit 7f390d0c00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,6 +16,7 @@ import store from "store";
import { logoutUser } from "actions/userActions";
import { AUTH_LOGIN_URL } from "constants/routes";
import { getCurrentGitBranch } from "selectors/gitSyncSelectors";
import getQueryParamsObject from "utils/getQueryParamsObject";
const executeActionRegex = /actions\/execute/;
const timeoutErrorRegex = /timeout of (\d+)ms exceeded/;
@ -38,11 +39,11 @@ const is404orAuthPath = () => {
// this will be used to calculate the time taken for an action
// execution request
export const apiRequestInterceptor = (config: AxiosRequestConfig) => {
const branch = getCurrentGitBranch(store.getState());
const branch =
getCurrentGitBranch(store.getState()) || getQueryParamsObject().branch;
if (branch) {
config.headers.branchName = branch;
}
if (config.url?.indexOf("/git/") !== -1) {
config.timeout = 1000 * 120; // increase timeout for git specific APIs
}