-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PE-4885: use new downloader on share file page #1443
PE-4885: use new downloader on share file page #1443
Conversation
implement the new downloader on the shared page
Visit the preview URL for this PR (updated for commit 6a26d37): https://ardrive-web--pr1443-pe-4885-use-new-down-ens4n8zn.web.app (expires Tue, 07 Nov 2023 13:24:14 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: a224ebaee2f0939e7665e7630e7d3d6cd7d0f8b0 |
|
||
if (fileKey != null && !isPinFile) { | ||
final dataTx = await (_arweave.getTransactionDetails(revision.dataTxId!)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We weren't checking if the dataTxId
was null before... Should we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the parentheses are unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments.
|
||
if (fileKey != null && !isPinFile) { | ||
final dataTx = await (_arweave.getTransactionDetails(revision.dataTxId!)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the parentheses are unnecessary.
} else { | ||
dataBytes = dataRes.data; | ||
|
||
cipher = dataTx.getTag(EntityTag.cipher); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: cipherTag
may be a more appropriate name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return; | ||
} | ||
|
||
logger.d('Download progress: $progress'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's perhaps too spammy to have this log here on every progress update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. 045ee86
fileSize: revision.size, | ||
lastModifiedDate: revision.lastModifiedDate, | ||
contentType: | ||
revision.contentType ?? lookupMimeTypeWithDefaultType(revision.name), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're using this expression many times, let's perhaps use a final var for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validate dataTxId
…5-use-new-downloader-on-share-file-page
validated if the browser is safari on share file download
implement the new downloader on the shared page
--- Releases ---
Android release: https://appdistribution.firebase.google.com/testerapps/1:305132849030:android:6cf0cd5ec064fad3ffce07/releases/5mdd8e2u4dmc8