Browse Source

Merge branch 'staging' of https://git.nwhco.ir/sina_sajjadi/marriage into staging

staging
Ali Alavi 4 days ago
parent
commit
dbeabbfe67
  1. 9
      src/components/Componentes/question-photo.tsx

9
src/components/Componentes/question-photo.tsx

@ -92,11 +92,15 @@ export function QuestionPhoto({
if (fileInputRef.current) { if (fileInputRef.current) {
fileInputRef.current.value = ""; fileInputRef.current.value = "";
} }
// Only show the toast if the user was actively uploading;
// stale stored URLs from previous sessions fail silently.
if (isUploading || isInitiatorRef.current) {
setToastMessage( setToastMessage(
t["Failed to load image. Please try uploading again."] ?? t["Failed to load image. Please try uploading again."] ??
"Failed to load image. Please try uploading again.", "Failed to load image. Please try uploading again.",
); );
}, [question, setAnswerValue, t]);
}
}, [question, setAnswerValue, t, isUploading]);
const uploadTmpMediaMutation = useUploadTmpMediaMutation({ const uploadTmpMediaMutation = useUploadTmpMediaMutation({
onSuccess: (response) => { onSuccess: (response) => {
@ -256,8 +260,7 @@ export function QuestionPhoto({
mediaType: "image", mediaType: "image",
source: pickerSource as any, source: pickerSource as any,
picker_type: pickerType as any, picker_type: pickerType as any,
returnAs: "upload",
uploadUrl: `${window.location.origin}/api/proxy?__proxyPath=/upload-tmp-media/`,
returnAs: "base64",
fieldName: "file", fieldName: "file",
allowedExtensions: allowedExtensions:
extensions.length > 0 ? extensions : ["jpg", "jpeg", "png", "webp"], extensions.length > 0 ? extensions : ["jpg", "jpeg", "png", "webp"],

Loading…
Cancel
Save