fix: Update map with tables fixes
This commit is contained in:
@@ -46,10 +46,16 @@ export const ImageUploadCard: React.FC<ImageUploadCardProps> = ({
|
||||
) => {
|
||||
const file = event.target.files?.[0];
|
||||
if (file) {
|
||||
setFileToUpload(file);
|
||||
setUploadMediaOpen(true);
|
||||
if (imageKey && setHardcodeType) {
|
||||
setHardcodeType(imageKey);
|
||||
if (file.type.startsWith("image/") && file.type !== "image/gif") {
|
||||
setFileToUpload(file);
|
||||
setUploadMediaOpen(true);
|
||||
if (imageKey && setHardcodeType) {
|
||||
setHardcodeType(imageKey);
|
||||
}
|
||||
} else if (file.type === "image/gif") {
|
||||
toast.error("GIF файлы не поддерживаются");
|
||||
} else {
|
||||
toast.error("Пожалуйста, выберите изображение");
|
||||
}
|
||||
}
|
||||
// Reset the input value so selecting the same file again triggers change
|
||||
@@ -78,9 +84,11 @@ export const ImageUploadCard: React.FC<ImageUploadCardProps> = ({
|
||||
const files = event.dataTransfer.files;
|
||||
if (files && files.length > 0) {
|
||||
const file = files[0];
|
||||
if (file.type.startsWith("image/")) {
|
||||
if (file.type.startsWith("image/") && file.type !== "image/gif") {
|
||||
setFileToUpload(file);
|
||||
setUploadMediaOpen(true);
|
||||
} else if (file.type === "image/gif") {
|
||||
toast.error("GIF файлы не поддерживаются");
|
||||
} else {
|
||||
toast.error("Пожалуйста, выберите изображение");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user