remove date, block global search for audio, video and documents
This commit is contained in:
@@ -45,6 +45,7 @@ export default function SectionSearchFile({ allowedExtensions, maxFileSize }: Se
|
||||
const [isFileUploaded, setIsFileUploaded] = useState<boolean>(false);
|
||||
const [uploadProgress, setUploadProgress] = useState<number>(0);
|
||||
const [fileId, setFileId] = useState<string | null>(null);
|
||||
const [fileType, setFileType] = useState<string | null>(null);
|
||||
const queryClient = useQueryClient();
|
||||
const isCancelledRef = useRef(false);
|
||||
|
||||
@@ -93,6 +94,7 @@ export default function SectionSearchFile({ allowedExtensions, maxFileSize }: Se
|
||||
if (fileId) {
|
||||
await removeUserFile(fileId, 1);
|
||||
setFileId(null);
|
||||
setFileType(null);
|
||||
}
|
||||
|
||||
setError(null);
|
||||
@@ -214,6 +216,7 @@ export default function SectionSearchFile({ allowedExtensions, maxFileSize }: Se
|
||||
|
||||
if (isLastChunk && chunkResponse.fileId) {
|
||||
setFileId(chunkResponse.fileId);
|
||||
setFileType(fileType);
|
||||
document.cookie = `searchedFileId=${chunkResponse.fileId}`
|
||||
}
|
||||
}
|
||||
@@ -348,7 +351,7 @@ export default function SectionSearchFile({ allowedExtensions, maxFileSize }: Se
|
||||
</div>
|
||||
|
||||
{isFileUploaded && (
|
||||
<FileSearchPanel fileId={fileId} ref={childRef} allowedExtensions={allowedExtensions} />
|
||||
<FileSearchPanel fileId={fileId} ref={childRef} allowedExtensions={allowedExtensions} fileType={fileType} />
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user