@@ -19,7 +19,7 @@ function formatDate(iso: string) {
1919}
2020
2121export default function DashboardPage ( ) {
22- const { repo } = useRepoStore ( ) ;
22+ const { repo, branch : selectedBranch } = useRepoStore ( ) ;
2323 const { result, setResultYaml } = usePipelineStore ( ) ;
2424 const cfg = useConfigStore ( ) ;
2525
@@ -36,7 +36,8 @@ export default function DashboardPage() {
3636 } , [ clear ] ) ;
3737
3838 const repoFullName = result ?. repo || repo || "" ;
39- const branch = ( result as any ) ?. branch || "main" ;
39+ const branchName =
40+ ( result as any ) ?. branch || selectedBranch || "main" ;
4041
4142 const [ versions , setVersions ] = useState < PipelineVersion [ ] > ( [ ] ) ;
4243 const [ loadingHistory , setLoadingHistory ] = useState ( false ) ;
@@ -65,7 +66,7 @@ export default function DashboardPage() {
6566 try {
6667 const rows = await api . getPipelineHistory ( {
6768 repoFullName,
68- branch,
69+ branch : branchName ,
6970 limit : 20 ,
7071 } ) ;
7172 if ( ! cancelled ) {
@@ -87,11 +88,11 @@ export default function DashboardPage() {
8788 cancelled = true ;
8889 } ;
8990 // eslint-disable-next-line react-hooks/exhaustive-deps
90- } , [ repoFullName , branch ] ) ;
91+ } , [ repoFullName , branchName ] ) ;
9192
9293 async function handleRollback ( version : PipelineVersion ) {
9394 if ( ! version ?. id ) return ;
94- const confirmMsg = `Rollback ${ repoFullName } @${ branch } to version created at ${ formatDate (
95+ const confirmMsg = `Rollback ${ repoFullName } @${ branchName } to version created at ${ formatDate (
9596 version . created_at
9697 ) } ?`;
9798 if ( ! window . confirm ( confirmMsg ) ) return ;
@@ -119,7 +120,7 @@ export default function DashboardPage() {
119120 function handleCommitClick ( ) {
120121 const repoFullNameLocal = result ?. repo || repo ;
121122 const yaml = result ?. generated_yaml ;
122- const branchLocal = result ?. branch || "main" ;
123+ const branchLocal = ( result as any ) ?. branch || branchName || "main" ;
123124 const environment = cfg . env || "dev" ;
124125 const provider = "aws" ;
125126 const path = `.github/workflows/${ environment } -deploy.yml` ;
@@ -146,7 +147,7 @@ export default function DashboardPage() {
146147 < h1 className = "text-2xl font-semibold" > Pipeline Dashboard</ h1 >
147148 { repoFullName ? (
148149 < p className = "text-sm text-muted-foreground" >
149- { repoFullName } @ < span className = "font-mono" > { branch } </ span >
150+ { repoFullName } @ < span className = "font-mono" > { branchName } </ span >
150151 </ p >
151152 ) : (
152153 < p className = "text-sm text-orange-600" >
0 commit comments