Skip to content

Commit b100fd7

Browse files
committed
remove console log statement
1 parent d470180 commit b100fd7

File tree

4 files changed

+29
-6
lines changed

4 files changed

+29
-6
lines changed

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ services:
1717
- http://localhost
1818
timeout: 10s
1919
hostname: gitconvex-container
20-
image: itassistors/gitconvex
20+
image: itassistors/gitconvex:2.0.0-beta
2121
labels:
2222
generated: by 8gwifi.org
2323
ports:

ui/src/Components/DashBoard/Repository/RepoComponents/AddRepoForm.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@ export default function AddRepoForm(props) {
146146
action: DELETE_PRESENT_REPO,
147147
payload: [],
148148
});
149-
150-
console.log(state.presentRepo);
151149
} else {
152150
setRepoAddFailed(true);
153151
setRepoAddSuccess(false);

ui/src/Components/DashBoard/Repository/RepoComponents/RepoDetails/RepoDetailBackdrop/BranchListComponent.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export default function BranchListComponent({ repoId, currentBranch }) {
1616
const [errorBranch, setErrorBranch] = useState("");
1717
const [deleteSuccess, setDeleteSuccess] = useState(false);
1818
const [deleteError, setDeleteError] = useState(false);
19+
const [loading, setLoading] = useState(false);
1920

2021
function resetStates() {
2122
setListError(false);
@@ -31,6 +32,7 @@ export default function BranchListComponent({ repoId, currentBranch }) {
3132
const token = axios.CancelToken;
3233
const source = token.source();
3334

35+
setLoading(true);
3436
setBranchList([]);
3537

3638
axios({
@@ -50,6 +52,8 @@ export default function BranchListComponent({ repoId, currentBranch }) {
5052
},
5153
})
5254
.then((res) => {
55+
setLoading(false);
56+
5357
if (res.data.data && !res.data.error) {
5458
let {
5559
gitAllBranchList,
@@ -75,6 +79,8 @@ export default function BranchListComponent({ repoId, currentBranch }) {
7579
}
7680
})
7781
.catch((err) => {
82+
setLoading(false);
83+
7884
if (err) {
7985
console.log("API error occurred : " + err);
8086
setListError(true);
@@ -86,6 +92,8 @@ export default function BranchListComponent({ repoId, currentBranch }) {
8692

8793
function switchBranchHandler(branchName) {
8894
resetStates();
95+
setLoading(true);
96+
setBranchList([]);
8997
axios({
9098
url: globalAPIEndpoint,
9199
method: "POST",
@@ -98,6 +106,8 @@ export default function BranchListComponent({ repoId, currentBranch }) {
98106
},
99107
})
100108
.then((res) => {
109+
setLoading(false);
110+
101111
if (res.data.data && !res.data.error) {
102112
const checkoutStatus = res.data.data.checkoutBranch;
103113
if (checkoutStatus === "CHECKOUT_FAILED") {
@@ -115,6 +125,8 @@ export default function BranchListComponent({ repoId, currentBranch }) {
115125
}
116126
})
117127
.catch((err) => {
128+
setLoading(false);
129+
118130
if (err) {
119131
setSwitchError(true);
120132
setErrorBranch(branchName);
@@ -124,6 +136,7 @@ export default function BranchListComponent({ repoId, currentBranch }) {
124136

125137
function deleteBranchHandler(branchName, forceFlag) {
126138
resetStates();
139+
setLoading(true);
127140

128141
axios({
129142
url: globalAPIEndpoint,
@@ -139,6 +152,8 @@ export default function BranchListComponent({ repoId, currentBranch }) {
139152
},
140153
})
141154
.then((res) => {
155+
setLoading(false);
156+
142157
if (res.data.data && !res.data.error) {
143158
if (res.data.data.deleteBranch.status === "BRANCH_DELETE_SUCCESS") {
144159
setDeleteSuccess(true);
@@ -150,6 +165,8 @@ export default function BranchListComponent({ repoId, currentBranch }) {
150165
}
151166
})
152167
.catch((err) => {
168+
setLoading(false);
169+
153170
if (err) {
154171
setDeleteError(true);
155172
setErrorBranch(branchName);
@@ -199,7 +216,7 @@ export default function BranchListComponent({ repoId, currentBranch }) {
199216
Click on a branch to checkout to that branch
200217
</div>
201218
<div className="branchlist--list-area" style={{ height: "400px" }}>
202-
{branchList.length === 0 && !listError ? (
219+
{loading ? (
203220
<div className="text-center font-sans font-light text-xl my-2 text-gray-600 border-b border-dotted">
204221
Collecting branch list...
205222
</div>

ui/src/Components/DashBoard/Repository/RepoComponents/RepoDetails/RepoDetailBackdrop/SwitchBranchComponent.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,16 @@ export default function SwitchBranchComponent({
2424
})
2525
.then((res) => {
2626
if (res.data.data && !res.data.error) {
27-
switchReloadView();
28-
closeBackdrop(true);
27+
const status = res.data.data.checkoutBranch;
28+
console.log(status);
29+
if (status === "CHECKOUT_FAILED") {
30+
setBranchError(true);
31+
} else {
32+
switchReloadView();
33+
closeBackdrop(true);
34+
}
35+
} else {
36+
setBranchError(true);
2937
}
3038
})
3139
.catch((err) => {

0 commit comments

Comments
 (0)