fix(downloads): an upload's cancel, progress, failure and notice speak of an upload
- Cancelling an upload asks "Delete upload?" and says the uploaded file is
removed from the server with it.
- The phone-safe conversion's real ffmpeg % shows as a bar ("Converting for
phones"), not an indeterminate pulse.
- A failed upload is titled "The upload isn't ready", with its own reasons
(convert_failed, retryable; upload_missing) instead of download copy.
- The inbox says "Upload ready to share" for a converted upload.
This commit is contained in:
@@ -35,6 +35,18 @@ import { menuGroups } from "./ui/menuGroups";
|
||||
export type DownloadTab = "queue" | "done" | "shared";
|
||||
export type JobOp = "pause" | "resume" | "cancel" | "delete" | "redownload";
|
||||
|
||||
// The Cancel confirmation of a queued job; an upload's names what it deletes.
|
||||
const CANCEL_DOWNLOAD = {
|
||||
title: "downloads.confirm.cancelTitle",
|
||||
body: "downloads.confirm.cancelBody",
|
||||
action: "downloads.confirm.cancelAction",
|
||||
};
|
||||
const CANCEL_UPLOAD = {
|
||||
title: "downloads.confirm.cancelUploadTitle",
|
||||
body: "downloads.confirm.cancelUploadBody",
|
||||
action: "downloads.confirm.cancelUploadAction",
|
||||
};
|
||||
|
||||
export function useDownloadActions({
|
||||
onPlay,
|
||||
onEdit,
|
||||
@@ -147,13 +159,14 @@ export function useDownloadActions({
|
||||
label: t("downloads.actions.cancel"),
|
||||
icon: icon(Ban),
|
||||
danger: true,
|
||||
onSelect: () =>
|
||||
void confirmThen(
|
||||
t("downloads.confirm.cancelTitle"),
|
||||
t("downloads.confirm.cancelBody"),
|
||||
t("downloads.confirm.cancelAction"),
|
||||
() => act.mutate({ id: job.id, op: "cancel" }),
|
||||
),
|
||||
// Cancelling an upload deletes the file it uploaded (there is nothing to fetch again), so
|
||||
// its confirmation says so — "stop the download" would read as safe to undo.
|
||||
onSelect: () => {
|
||||
const copy = job.job_kind === "upload" ? CANCEL_UPLOAD : CANCEL_DOWNLOAD;
|
||||
void confirmThen(t(copy.title), t(copy.body), t(copy.action), () =>
|
||||
act.mutate({ id: job.id, op: "cancel" }),
|
||||
);
|
||||
},
|
||||
},
|
||||
],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user