- Delete dead top-level downloads.rename.* i18n block (en/hu/de); the metadata modal moved to downloads.edit.*. Keep downloads.actions.rename (still used by ProfileEditor). - Rename misnamed state renameJob/setRenameJob -> metaJob/setMetaJob in DownloadCenter (it opens MetaEditModal, not a rename dialog). - Extract the duplicated [downloads]/[download-index]/[download-usage] invalidation trio into lib/downloads.ts invalidateDownloads(qc); used by DownloadCenter and DownloadDialog. Behavior-neutral. tsc green, knip shows no new unused export, JSON valid.
9 lines
477 B
TypeScript
9 lines
477 B
TypeScript
import type { QueryClient } from "@tanstack/react-query";
|
|
|
|
// The download queue, the per-card download index, and the storage-usage meter all move together
|
|
// whenever a job is enqueued, deleted, or its state changes — invalidate them as one unit.
|
|
export function invalidateDownloads(qc: QueryClient) {
|
|
qc.invalidateQueries({ queryKey: ["downloads"] });
|
|
qc.invalidateQueries({ queryKey: ["download-index"] });
|
|
qc.invalidateQueries({ queryKey: ["download-usage"] });
|
|
}
|