(patch) tus: Fix upload not found scenario (#1814)

Second attempt, this time just hiding the cancel button when the upload is done. If user is impatient and refreshed in between this and `notify`, it will still be resumable later.

Bumped MINIMUM_VERSION to nudge for a refresh so we get a slightly more accurate logging, and also to prevent the issue from lingering.
This commit is contained in:
infinite-persistence 2022-07-08 18:45:43 +08:00 committed by GitHub
parent 294c5194a4
commit 73e6dfd399
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View file

@ -4,7 +4,7 @@
# --- Minimum Version (Format: YYYYMMDDNNN) --- # --- Minimum Version (Format: YYYYMMDDNNN) ---
# Bump this when we want to nudge the user to refresh. # Bump this when we want to nudge the user to refresh.
MINIMUM_VERSION=20220705001 MINIMUM_VERSION=20220708001
# --- Base config --- # --- Base config ---
WEBPACK_WEB_PORT=9090 WEBPACK_WEB_PORT=9090

View file

@ -142,7 +142,9 @@ export default function WebUploadItem(props: Props) {
function getCancelButton() { function getCancelButton() {
if (!locked) { if (!locked) {
if (status === 'notify') { if (parseInt(progress) === 100) {
return null;
} else if (status === 'notify') {
return ( return (
<Button <Button
button="link" button="link"

View file

@ -147,6 +147,8 @@ export function makeResumableUploadRequest(
xhr.send(jsonPayload); xhr.send(jsonPayload);
} }
// Server needs time to process the upload before we can send `notify`.
// TODO: Is it file-size dependent?
setTimeout(() => makeNotifyRequest(), 15000); setTimeout(() => makeNotifyRequest(), 15000);
}, },
}); });