revert: scan link early return

Refs: fbde15e075d92bf4070b75f5decc554ca18db02e.
This commit is contained in:
enes 2025-01-17 12:49:34 +01:00
parent fbde15e075
commit 32f35ebcca

View File

@ -622,17 +622,13 @@ const Download = ({
const isFile = await checkUrlForFile(url) const isFile = await checkUrlForFile(url)
setShowNotice(!isFile) setShowNotice(!isFile)
if (!malwareScanLink) {
setShowCanNotice(true)
return
}
// Check the malware scan url // Check the malware scan url
// if it's valid URL // if it's valid URL
// if it contains sha256 // if it contains sha256
// if it differs from download link // if it differs from download link
setShowCanNotice( setShowCanNotice(
!( !(
malwareScanLink &&
isValidUrl(malwareScanLink) && isValidUrl(malwareScanLink) &&
/\b[a-fA-F0-9]{64}\b/.test(malwareScanLink) && /\b[a-fA-F0-9]{64}\b/.test(malwareScanLink) &&
malwareScanLink !== url malwareScanLink !== url