@@ -10,24 +10,20 @@ export default function BranchListComponent({ repoId }) {
10
10
11
11
const [ branchList , setBranchList ] = useState ( [ ] ) ;
12
12
const [ listError , setListError ] = useState ( false ) ;
13
- const [ switchSuccess , setSwitchSuccess ] = useState ( false ) ;
14
13
const [ switchError , setSwitchError ] = useState ( false ) ;
15
14
const [ switchedBranch , setSwitchedBranch ] = useState ( "" ) ;
16
15
const [ errorBranch , setErrorBranch ] = useState ( "" ) ;
17
- const [ deleteSuccess , setDeleteSuccess ] = useState ( false ) ;
18
16
const [ deleteError , setDeleteError ] = useState ( false ) ;
19
17
const [ loading , setLoading ] = useState ( false ) ;
20
18
const [ branchSearchTerm , setBranchSearchTerm ] = useState ( "" ) ;
21
19
const [ filteredBranchList , setFilteredBranchList ] = useState ( [ ] ) ;
22
20
23
21
function resetStates ( ) {
24
22
setListError ( false ) ;
25
- setSwitchSuccess ( false ) ;
26
23
setSwitchError ( false ) ;
27
24
setSwitchedBranch ( "" ) ;
28
25
setErrorBranch ( "" ) ;
29
26
setDeleteError ( false ) ;
30
- setDeleteSuccess ( false ) ;
31
27
setBranchSearchTerm ( "" ) ;
32
28
setFilteredBranchList ( [ ] ) ;
33
29
}
@@ -114,12 +110,10 @@ export default function BranchListComponent({ repoId }) {
114
110
if ( res . data . data && ! res . data . error ) {
115
111
const checkoutStatus = res . data . data . checkoutBranch ;
116
112
if ( checkoutStatus === "CHECKOUT_FAILED" ) {
117
- setSwitchSuccess ( false ) ;
118
113
setErrorBranch ( branchName ) ;
119
114
setSwitchError ( true ) ;
120
115
return ;
121
116
} else {
122
- setSwitchSuccess ( true ) ;
123
117
setSwitchedBranch ( branchName ) ;
124
118
}
125
119
} else {
@@ -159,7 +153,6 @@ export default function BranchListComponent({ repoId }) {
159
153
160
154
if ( res . data . data && ! res . data . error ) {
161
155
if ( res . data . data . deleteBranch . status === "BRANCH_DELETE_SUCCESS" ) {
162
- setDeleteSuccess ( true ) ;
163
156
setSwitchedBranch ( branchName ) ;
164
157
} else {
165
158
setDeleteError ( true ) ;
0 commit comments