fix(notifications): name the entity in action toasts

Eight confirmations stated a bare fact without saying what they acted on. Pass
the entity through the mutation variables and interpolate it: channel
unsubscribe/reset name the channel, whitelist/demo-whitelist adds name the
email, tag delete names the tag, and playlist revert/push name the playlist.
EN/HU/DE.
This commit is contained in:
npeter83 2026-06-26 00:32:17 +02:00
parent 557f2cef9c
commit 6c4c33f956
16 changed files with 45 additions and 43 deletions

View file

@ -353,11 +353,12 @@ export default function Playlists({ canWrite }: { canWrite: boolean }) {
danger: true,
});
if (!ok) return;
const plName = detail.kind === "watch_later" ? t("playlists.watchLater") : detail.name;
setReverting(true);
try {
await api.revertPlaylist(selectedId);
refreshAll();
notify({ level: "success", message: t("playlists.revertDone") });
notify({ level: "success", message: t("playlists.revertDone", { name: plName }) });
} catch {
notify({ level: "warning", message: t("playlists.revertFailed") });
} finally {
@ -367,11 +368,12 @@ export default function Playlists({ canWrite }: { canWrite: boolean }) {
async function pushToYoutube() {
if (selectedId == null || !detail || pushing) return;
const plName = detail.kind === "watch_later" ? t("playlists.watchLater") : detail.name;
setPushing(true);
try {
const plan = await api.playlistPushPlan(selectedId);
if (plan.action === "update" && !plan.to_insert && !plan.to_delete && !plan.to_reorder) {
notify({ level: "info", message: t("playlists.pushUpToDate") });
notify({ level: "info", message: t("playlists.pushUpToDate", { name: plName }) });
return;
}
if (!plan.affordable) {
@ -410,7 +412,7 @@ export default function Playlists({ canWrite }: { canWrite: boolean }) {
if (r.failures.length) {
notify({ level: "warning", message: t("playlists.pushPartial", { count: r.failures.length }) });
} else {
notify({ level: "success", message: t("playlists.pushDone") });
notify({ level: "success", message: t("playlists.pushDone", { name: plName }) });
}
} catch {
notify({ level: "warning", message: t("playlists.pushFailed") });