Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore(frontend): auto select source branch when rebasing (#10457)

Liu Ji084d55c620a3
diff --git a/frontend/src/components/Branch/BranchRebaseView/BranchRebaseView.vue b/frontend/src/components/Branch/BranchRebaseView/BranchRebaseView.vue
index a30d1faa35..fd9c588cd7 100644
--- a/frontend/src/components/Branch/BranchRebaseView/BranchRebaseView.vue
+++ b/frontend/src/components/Branch/BranchRebaseView/BranchRebaseView.vue
@@ -272,24 +272,25 @@ const handleRebaseBranch = async () => {
watch(
headBranch,
- (head) => {
- if (head) {
- // Automatically set the sourceDatabase to the branch's baselineDatabase
- // if sourceDatabase is empty
- if (!state.sourceDatabaseUID) {
- const db = useDatabaseV1Store().getDatabaseByName(
- head.baselineDatabase
- );
- state.sourceDatabaseUID = db.uid;
- state.sourceType = "DATABASE";
- }
+ (head, prevValue) => {
+ if (!head) return;
+ if (!prevValue && route.query.source) {
+ // Initial head branch loaded
+ return;
+ }
+ // Automatically set the sourceDatabase to the branch's baselineDatabase
+ // if sourceDatabase is empty
+ if (!state.sourceDatabaseUID) {
+ const db = useDatabaseV1Store().getDatabaseByName(head.baselineDatabase);
+ state.sourceDatabaseUID = db.uid;
+ state.sourceType = "DATABASE";
+ }
- // Automatically select the branch's parent as rebase source branch
- // if rebase source is empty
- if (head.parentBranch && !state.sourceBranchName) {
- state.sourceBranchName = head.parentBranch;
- state.sourceType = "BRANCH";
- }
+ // Automatically select the branch's parent as rebase source branch
+ // if rebase source is empty
+ if (head.parentBranch && !state.sourceBranchName) {
+ state.sourceBranchName = head.parentBranch;
+ state.sourceType = "BRANCH";
}
},
{
@@ -301,6 +302,7 @@ onMounted(() => {
if (route.query.source) {
const source = `${props.project.name}/branches/${route.query.source}`;
state.sourceBranchName = source;
+ state.sourceType = "BRANCH";
}
});
</script>