fix: minor changes

This commit is contained in:
Paribesh01
2025-02-07 01:06:24 +05:30
parent 12b7dbd567
commit 787cf2d56f
2 changed files with 1 additions and 5 deletions

View File

@@ -151,7 +151,7 @@ export const EditLogo = ({ project, environmentId, isReadOnly }: EditLogoProps)
<Input
ref={fileInputRef}
type="file"
accept="image/jpeg, image/png, image/webp"
accept="image/jpeg, image/png, image/webp, image/heic"
className="hidden"
disabled={isReadOnly}
onChange={handleFileChange}

View File

@@ -113,13 +113,10 @@ export const getAllowedFiles = async (
const extension = file.name.split(".").pop()?.toLowerCase();
const fileSizeInMB = file.size / 1000000;
console.log("going inside");
if (extension === "heic") {
try {
console.log("converting heic file", file.name);
const convertedFile = await convertHeicToJpeg(file);
if (convertedFile) {
console.log("converted file", convertedFile);
convertedFiles.push(
new File([convertedFile], file.name.replace(/\.heic$/i, ".jpg"), {
type: "image/jpeg",
@@ -128,7 +125,6 @@ export const getAllowedFiles = async (
}
continue;
} catch (error) {
console.error("Error converting HEIC file:", error);
unsupportedExtensionFiles.push(file.name);
continue;
}