diff --git a/app/client/cypress/support/Pages/GitSync.ts b/app/client/cypress/support/Pages/GitSync.ts index 020ee9a66e..08127b1c7f 100644 --- a/app/client/cypress/support/Pages/GitSync.ts +++ b/app/client/cypress/support/Pages/GitSync.ts @@ -35,7 +35,7 @@ export class GitSync { } CreateNConnectToGit( - repoName: string = "Test", + repoName = "Test", assertConnect = true, privateFlag = false, ) { @@ -129,7 +129,7 @@ export class GitSync { }); } - CreateGitBranch(branch: string = "Test", toUseNewGuid = false) { + CreateGitBranch(branch = "Test", toUseNewGuid = false) { if (toUseNewGuid) this.agHelper.GenerateUUID(); this.agHelper.AssertElementExist(this._bottomBarCommit); this.agHelper.GetNClick(this._branchButton); diff --git a/app/client/src/entities/Engine/index.ts b/app/client/src/entities/Engine/index.ts index d32e66416a..6fcb1dd258 100644 --- a/app/client/src/entities/Engine/index.ts +++ b/app/client/src/entities/Engine/index.ts @@ -16,6 +16,7 @@ import history from "utils/history"; import URLRedirect from "entities/URLRedirect/index"; import URLGeneratorFactory from "entities/URLRedirect/factory"; import { updateBranchLocally } from "actions/gitSyncActions"; +import { getCurrentGitBranch } from "selectors/gitSyncSelectors"; export type AppEnginePayload = { applicationId?: string; @@ -69,7 +70,14 @@ export default abstract class AppEngine { if (!apiCalls) throw new PageNotFoundError(`Cannot find page with id: ${pageId}`); const application: ApplicationPayload = yield select(getCurrentApplication); - yield put(updateAppStore(getPersistentAppStore(application.id, branch))); + const currentGitBranch: ReturnType = yield select( + getCurrentGitBranch, + ); + yield put( + updateAppStore( + getPersistentAppStore(application.id, branch || currentGitBranch), + ), + ); const toLoadPageId: string = pageId || (yield select(getDefaultPageId)); this._urlRedirect = URLGeneratorFactory.create( application.applicationVersion,