diff --git a/web/src/components/IdeCascadeStudio/IdeCascadeStudio.js b/web/src/components/IdeCascadeStudio/IdeCascadeStudio.js index e7e37e8..62623e9 100644 --- a/web/src/components/IdeCascadeStudio/IdeCascadeStudio.js +++ b/web/src/components/IdeCascadeStudio/IdeCascadeStudio.js @@ -76,27 +76,23 @@ const IdeCascadeStudio = ({ part, saveCode, loading }) => { // Get the canvas image as a Data URL const imgBlob = await CascadeController.capture(threejsViewport.environment) - async function uploadAndUpdateImage(){ - // Upload the image to Cloudinary - const cloudinaryImg = await uploadToCloudinary(imgBlob) + // Upload the image to Cloudinary + const cloudinaryImg = await uploadToCloudinary(imgBlob) - // Save the screenshot as the mainImage - saveCode({ - input: { - code, - title: part?.title, - userId: currentUser?.sub, - description: part?.description, - mainImage: cloudinaryImg.public_id, - }, - id: part.id, - isFork: !canEdit, - }) + // Save the screenshot as the mainImage + saveCode({ + input: { + code, + title: part?.title, + userId: currentUser?.sub, + description: part?.description, + mainImage: cloudinaryImg.public_id, + }, + id: part?.id, + isFork: !canEdit, + }) - return cloudinaryImg - } - - return { image: imgBlob, mainImage: part.mainImage, callback: uploadAndUpdateImage} + return { imgBlob, cloudinaryImg } }} /> diff --git a/web/src/components/IdeToolbar/IdeToolbar.js b/web/src/components/IdeToolbar/IdeToolbar.js index acfb543..efff79e 100644 --- a/web/src/components/IdeToolbar/IdeToolbar.js +++ b/web/src/components/IdeToolbar/IdeToolbar.js @@ -112,7 +112,7 @@ const IdeToolbar = ({ const url = URL.createObjectURL(imgBlob) aTag.href= url aTag.style.display = 'none' - aTag.download = `CodeCad_${ Date.now() }.jpg` + aTag.download = `CadHub_${ Date.now() }.jpg` aTag.click() } @@ -240,7 +240,7 @@ const IdeToolbar = ({ }} className="text-indigo-300 flex items-center pr-6" > - Capture + Set Part Image
- +
- { (captureState.mainImage && !captureState.updated) - ? - :
- Part Image Set -
- } +
+ Part Image Set +
diff --git a/web/src/components/Svg/Svg.js b/web/src/components/Svg/Svg.js index 20d8769..47bbb76 100644 --- a/web/src/components/Svg/Svg.js +++ b/web/src/components/Svg/Svg.js @@ -38,19 +38,19 @@ const Svg = ({ name, className: className2, strokeWidth = 2 }) => { + strokeWidth="2" + strokeLinecap="round"/> + strokeWidth="2"/> + strokeWidth="2" + strokeLinecap="round"/> ), 'checkmark': ( @@ -59,8 +59,8 @@ const Svg = ({ name, className: className2, strokeWidth = 2 }) => { viewBox="0 0 21 20" fill="none"> ), @@ -319,8 +319,8 @@ const Svg = ({ name, className: className2, strokeWidth = 2 }) => { + strokeWidth="2" + strokeLinecap="round"/> ), save: (