Skip to content

Commit

Permalink
filip(fix): wallet downloaders build issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fstoqnov-iohk committed Oct 30, 2024
1 parent 5fa8138 commit 4a0109a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 21 deletions.
4 changes: 2 additions & 2 deletions src/components/SharedComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const CopyInputContainer = styled.div`
display: flex;
margin-bottom: 1rem;
margin-top: 0.25rem;
border: 1px solid var(--text-field-content-color);
border: 1px solid var(--text-field-content-color) !important;
border-radius: 4px;
`

Expand Down Expand Up @@ -132,7 +132,7 @@ export const TextFieldWrapper = styled.div`
export const StyledTextField = styled(TextField)`
padding: 1rem !important;
border-radius: 0.25rem !important;
border: 1px solid var(--text-field-content-color);
border: 1px solid var(--text-field-content-color) !important;
margin: 0.25rem 0 !important;
&:focus-within {
Expand Down
33 changes: 14 additions & 19 deletions src/components/WalletDownloaders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -278,23 +278,17 @@ const WalletDownloaders = ({ env }) => {

const getPGPFilename = (URL) => `${getFilename(URL)}.asc`

const getPGPBlob = (signature) =>
window.Blob && new window.Blob([signature], { type: 'text/txt' })
// const getPGPBlob = (signature) => {
// if (window) {
// return window.Blob && new window.Blob([signature], { type: 'text/txt' })
// }
// }

const getPGPSignatureHref = (signature) => {
const blob = getPGPBlob(signature)
// const getPGPSignatureHref = (signature) => {
// const blob = getPGPBlob(signature)

return blob ? URL.createObjectURL(blob) : '#'
}

const onDownloadPGPSignature = (signature, URL) => (e) => {
// @ts-ignore
if (window.navigator.msSaveBlob || e.target.href === '#') e.preventDefault()
// @ts-ignore
if (window.navigator.msSaveBlob)
// @ts-ignore
window.navigator.msSaveBlob(getPGPBlob(signature), getPGPFilename(URL))
}
// return blob ? URL.createObjectURL(blob) : '#'
// }

const unCacheURL = (url) => {
return url + '?t=' + new Date().getTime()
Expand Down Expand Up @@ -362,7 +356,7 @@ const WalletDownloaders = ({ env }) => {
<span>
{version}: {version}
</span>
<DownloadButton href={unCacheURL(URL)} variant="contained">
<DownloadButton href={URL} variant="contained">
{short_label}
<DownloadIcon />
</DownloadButton>
Expand Down Expand Up @@ -410,13 +404,14 @@ const WalletDownloaders = ({ env }) => {
</ModalContent>
</Modal>
<Link
onClick={onDownloadPGPSignature(signature, URL)}
// onClick={onDownloadPGPSignature(signature, URL)}
tracking={{
category: gaCategory,
label: `download_pgp_signature_${key}_${version}`,
}}
href={getPGPSignatureHref(signature)}
download={getPGPFilename(URL)}
href={'https://google.com'}
// href={getPGPSignatureHref(signature)}
// download={getPGPFilename(URL)}
>
{'PGP signature'}
<DownloadIcon />
Expand Down

0 comments on commit 4a0109a

Please sign in to comment.