Compare commits

...

4 Commits

Author SHA1 Message Date
b
076e19b435 Merge branch 'main' into issue-27 2024-05-15 12:27:24 +00:00
s
a02f6859b8 Merge pull request 'Entering decryption key manually does not work because of encoded URI' (#37) from issue32 into main
All checks were successful
Release / build_and_release (push) Successful in 1m7s
Reviewed-on: https://git.sigit.io/sig/it/pulls/37
2024-05-15 11:16:02 +00:00
Leonardo Davinci
6e5b6ccc02 Merge branch 'main' into issue32 2024-05-15 09:58:25 +00:00
Davinci
e498ecb082 fix: entering decryption key manually does not work because of encoded URI 2024-05-15 11:57:35 +02:00

View File

@ -24,20 +24,22 @@ export const DecryptZip = () => {
const fileUrl = searchParams.get('file')
if (fileUrl) {
const decodedFileUrl = decodeURIComponent(fileUrl)
setIsLoading(true)
setLoadingSpinnerDesc('Fetching zip file')
axios
.get(fileUrl, {
.get(decodedFileUrl, {
responseType: 'arraybuffer'
})
.then((res) => {
const fileName = fileUrl.split('/').pop()
const fileName = decodedFileUrl.split('/').pop()
const file = new File([res.data], fileName!)
setSelectedFile(file)
})
.catch((err) => {
console.error(
`error occurred in getting zip file from ${fileUrl}`,
`error occurred in getting zip file from ${decodedFileUrl}`,
err
)
})
@ -47,7 +49,10 @@ export const DecryptZip = () => {
}
const key = searchParams.get('key')
if (key) setEncryptionKey(key)
if (key) {
const decodedKey = decodeURIComponent(key)
setEncryptionKey(decodedKey)
}
}, [searchParams])
const handleDecrypt = async () => {