Fix v1-publish items not removable (#1823)

## Issue
https://odysee-workspace.slack.com/archives/C02GSHBKYEM/p1657571082411839?thread_ts=1654909550.197639&cid=C02GSHBKYEM

If the user refreshed on a v1 upload, we can't do much but must at least provide a Cancel button for them to remove the entry.

## Change
- Restore the cancel button behavior for v1 like it was before.  The recent changes on the visibility of the Cancel button should only be applied to v2.
- Also fixed missing cancel button on v2 after refresh if the progress reached 100%.
This commit is contained in:
infinite-persistence 2022-07-12 13:13:58 +08:00 committed by GitHub
parent 62f90ae93e
commit 8aa6a60acf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -142,9 +142,8 @@ export default function WebUploadItem(props: Props) {
function getCancelButton() {
if (!locked) {
if (parseInt(progress) === 100) {
return null;
} else if (status === 'notify') {
if (resumable) {
if (status === 'notify') {
return (
<Button
button="link"
@ -178,6 +177,9 @@ export default function WebUploadItem(props: Props) {
}}
/>
);
} else if (parseInt(progress) === 100) {
return null;
}
}
return <Button label={__('Cancel')} button="link" onClick={handleCancel} />;