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