Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
gearnode
2025-03-01 20:14:14 +01:00
parent 5e079f8c9e
commit 3fb04c99fe

View File

@@ -568,24 +568,18 @@ function ControlOverviewPageContent({
filename: string;
mimeType: string;
}) => {
// Just open the modal with the evidence info
setPreviewEvidence({
id: evidence.id,
filename: evidence.filename,
mimeType: evidence.mimeType,
});
setIsPreviewModalOpen(true);
// We'll fetch the fileUrl when the modal opens
setIsLoadingFileUrl(true);
// Use GraphQL query to fetch the fileUrl
fetchQuery(environment, getEvidenceFileUrlQuery, {
evidenceId: evidence.id,
})
.toPromise()
.then((response) => {
// Type assertion for the response
const data = response as { node?: { id: string; fileUrl?: string } };
if (data?.node?.fileUrl) {