File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed
services/frontend/src/components/deploy/steps Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -137,22 +137,42 @@ function handleRepoChange(repoId: any) {
137137 const repo = repositories .value .find (r => r .id .toString () === repoIdStr )
138138 if (! repo ) return
139139
140+ // Reset state when switching repositories
141+ selectedRepo .value = null
142+ branch .value = ' '
143+ branches .value = []
144+ branchesError .value = null
145+
146+ // Emit empty state to parent to disable Next button
147+ emit (' update:modelValue' , {
148+ url: ' ' ,
149+ name: ' ' ,
150+ branch: ' '
151+ })
152+
153+ // Now set the new repository
140154 selectedRepo .value = repo
141155 selectedRepoId .value = repoIdStr
142- branch .value = repo .default_branch
143156
144157 // Fetch branches for the selected repository
145158 fetchBranches (repo )
146159}
147160
148161// Watch for changes and emit to parent
149162watch ([selectedRepo , branch ], () => {
150- if (selectedRepo .value ) {
163+ if (selectedRepo .value && branch . value ) {
151164 emit (' update:modelValue' , {
152165 url: selectedRepo .value .clone_url ,
153166 name: selectedRepo .value .full_name ,
154167 branch: branch .value
155168 })
169+ } else {
170+ // If repo or branch is missing, emit empty state
171+ emit (' update:modelValue' , {
172+ url: ' ' ,
173+ name: ' ' ,
174+ branch: ' '
175+ })
156176 }
157177})
158178
You can’t perform that action at this time.
0 commit comments