fix(devbox): jb bug download circle (#5354)

* fix: bug

* chore: remove console.log
This commit is contained in:
Alex Lee
2025-01-20 17:54:35 +08:00
committed by GitHub
parent af907750a7
commit b33e2ecf05
@@ -78,8 +78,6 @@ const JetBrainsGuideModal = ({
);
const data = await res.json();
setOnConnecting(true);
const controller = new AbortController();
controllerRef.current = controller;
@@ -92,7 +90,7 @@ const JetBrainsGuideModal = ({
const execDownloadCommand = `
IDE_DIR="${basePath}/.cache/JetBrains/${idePathName}${version}";
if [ -d "$IDE_DIR" ] && [ ! -f "$IDE_DIR/${selectedIDE.binName}" ]; then
if [ -d "$IDE_DIR" ] && [ ! -f "$IDE_DIR/bin/${selectedIDE.binName}" ]; then
rm -rf "$IDE_DIR";
fi;
[ ! -d ${basePath}/.cache/JetBrains/${idePathName}${version} ] && mkdir -p ${basePath}/.cache/JetBrains/${idePathName}${version} && wget -q --show-progress --progress=bar:force -O- ${downloadLink} | tar -xzC ${basePath}/.cache/JetBrains/${idePathName}${version} --strip-components=1 && chmod -R 776 ${basePath}/.cache && chown -R devbox:devbox ${basePath}/.cache`;
@@ -112,6 +110,9 @@ const JetBrainsGuideModal = ({
if (progress) {
setProgress(progress);
}
if (progress && progress === 1) {
setOnConnecting(true);
}
},
signal: controller.signal
});
@@ -128,7 +129,7 @@ const JetBrainsGuideModal = ({
setProgress(0);
setOnConnecting(false);
}
}, [selectedIDE, jetbrainsGuideData.devboxName, connectIDE]);
}, [selectedIDE, jetbrainsGuideData.devboxName, connectIDE, jetbrainsGuideData.workingDir]);
return (
<Box>