fix(errors): surface four mutations that failed silently (C-3.23)
House policy: user actions must report failure. Added onError to: - ChannelPage block + unsubscribe → notifyYouTubeActionError (a 403 = missing YT scope shows the connect message; else the translated fallback); - SettingsPanel PlexWatchSync toggle + reimport → a plain error notify (these are Plex, not YouTube, so notifyYouTubeActionError's "connect YouTube" would mislead); - DownloadCenter job action (pause/resume/cancel/delete) → a plain error notify. New keys (HU+EN): channels.notify.blockFailed, settings.plexSync.failed, downloads.actionFailed.
This commit is contained in:
@@ -120,6 +120,7 @@ export default function ChannelPage({
|
|||||||
qc.invalidateQueries({ queryKey: ["feed"] });
|
qc.invalidateQueries({ queryKey: ["feed"] });
|
||||||
qc.invalidateQueries({ queryKey: ["blocked-channels"] });
|
qc.invalidateQueries({ queryKey: ["blocked-channels"] });
|
||||||
},
|
},
|
||||||
|
onError: (err) => notifyYouTubeActionError(err, t("channels.notify.blockFailed")),
|
||||||
});
|
});
|
||||||
|
|
||||||
const subscribe = useMutation({
|
const subscribe = useMutation({
|
||||||
@@ -144,6 +145,7 @@ export default function ChannelPage({
|
|||||||
qc.invalidateQueries({ queryKey: ["feed"] });
|
qc.invalidateQueries({ queryKey: ["feed"] });
|
||||||
qc.invalidateQueries({ queryKey: ["channels"] });
|
qc.invalidateQueries({ queryKey: ["channels"] });
|
||||||
},
|
},
|
||||||
|
onError: (err) => notifyYouTubeActionError(err, t("channels.notify.unsubscribeFailed")),
|
||||||
});
|
});
|
||||||
const onUnsubscribe = async () => {
|
const onUnsubscribe = async () => {
|
||||||
const ok = await confirm({
|
const ok = await confirm({
|
||||||
|
|||||||
@@ -681,6 +681,7 @@ export default function DownloadCenter() {
|
|||||||
? api.cancelDownload(id)
|
? api.cancelDownload(id)
|
||||||
: api.deleteDownload(id),
|
: api.deleteDownload(id),
|
||||||
onSuccess: invalidate,
|
onSuccess: invalidate,
|
||||||
|
onError: () => notify({ level: "error", message: t("downloads.actionFailed") }),
|
||||||
});
|
});
|
||||||
|
|
||||||
// Remove a shared-with-me item from your list (only your grant; the owner's file is untouched).
|
// Remove a shared-with-me item from your list (only your grant; the owner's file is untouched).
|
||||||
|
|||||||
@@ -533,12 +533,14 @@ function PlexWatchSync() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onFail = () => notify({ level: "error", message: t("settings.plexSync.failed") });
|
||||||
const toggle = useMutation({
|
const toggle = useMutation({
|
||||||
mutationFn: (next: boolean) => api.plexWatchSetLink(next),
|
mutationFn: (next: boolean) => api.plexWatchSetLink(next),
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
qc.setQueryData(["plex-watch-link"], res);
|
qc.setQueryData(["plex-watch-link"], res);
|
||||||
announce(res.import);
|
announce(res.import);
|
||||||
},
|
},
|
||||||
|
onError: onFail,
|
||||||
});
|
});
|
||||||
const reimport = useMutation({
|
const reimport = useMutation({
|
||||||
mutationFn: () => api.plexWatchImport(),
|
mutationFn: () => api.plexWatchImport(),
|
||||||
@@ -546,6 +548,7 @@ function PlexWatchSync() {
|
|||||||
qc.setQueryData(["plex-watch-link"], res);
|
qc.setQueryData(["plex-watch-link"], res);
|
||||||
announce(res.import);
|
announce(res.import);
|
||||||
},
|
},
|
||||||
|
onError: onFail,
|
||||||
});
|
});
|
||||||
|
|
||||||
const busy = toggle.isPending || reimport.isPending;
|
const busy = toggle.isPending || reimport.isPending;
|
||||||
|
|||||||
@@ -119,6 +119,7 @@
|
|||||||
"syncFailed": "Subscription sync failed",
|
"syncFailed": "Subscription sync failed",
|
||||||
"unsubscribed": "Unsubscribed from {{name}} on YouTube",
|
"unsubscribed": "Unsubscribed from {{name}} on YouTube",
|
||||||
"unsubscribeFailed": "Unsubscribe failed",
|
"unsubscribeFailed": "Unsubscribe failed",
|
||||||
|
"blockFailed": "Couldn't update block state",
|
||||||
"fullHistoryRequested": "Full history requested for {{count}} channels",
|
"fullHistoryRequested": "Full history requested for {{count}} channels",
|
||||||
"fullHistoryFailed": "Couldn't request full history",
|
"fullHistoryFailed": "Couldn't request full history",
|
||||||
"needYouTube": "Connect your YouTube account to do this.",
|
"needYouTube": "Connect your YouTube account to do this.",
|
||||||
|
|||||||
@@ -197,5 +197,6 @@
|
|||||||
"source_not_ready": "The source download isn't ready to edit.",
|
"source_not_ready": "The source download isn't ready to edit.",
|
||||||
"generic": "That edit couldn't be created."
|
"generic": "That edit couldn't be created."
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"actionFailed": "Download action failed"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,8 @@
|
|||||||
"imported": "Imported from Plex: {{watched}} watched, {{in_progress}} in progress.",
|
"imported": "Imported from Plex: {{watched}} watched, {{in_progress}} in progress.",
|
||||||
"lastSync": "Last import: {{when}}",
|
"lastSync": "Last import: {{when}}",
|
||||||
"never": "Not imported yet",
|
"never": "Not imported yet",
|
||||||
"importing": "Importing your Plex watch history…"
|
"importing": "Importing your Plex watch history…",
|
||||||
|
"failed": "Plex watch sync failed"
|
||||||
},
|
},
|
||||||
"save": {
|
"save": {
|
||||||
"saving": "Saving…",
|
"saving": "Saving…",
|
||||||
|
|||||||
@@ -119,6 +119,7 @@
|
|||||||
"syncFailed": "A feliratkozások szinkronizálása sikertelen",
|
"syncFailed": "A feliratkozások szinkronizálása sikertelen",
|
||||||
"unsubscribed": "Leiratkozva a(z) {{name}} csatornáról a YouTube-on",
|
"unsubscribed": "Leiratkozva a(z) {{name}} csatornáról a YouTube-on",
|
||||||
"unsubscribeFailed": "A leiratkozás sikertelen",
|
"unsubscribeFailed": "A leiratkozás sikertelen",
|
||||||
|
"blockFailed": "A tiltás állapotát nem sikerült frissíteni",
|
||||||
"fullHistoryRequested": "Teljes előzmény kérve {{count}} csatornához",
|
"fullHistoryRequested": "Teljes előzmény kérve {{count}} csatornához",
|
||||||
"fullHistoryFailed": "Nem sikerült teljes előzményt kérni",
|
"fullHistoryFailed": "Nem sikerült teljes előzményt kérni",
|
||||||
"needYouTube": "Ehhez csatlakoztasd a YouTube-fiókod.",
|
"needYouTube": "Ehhez csatlakoztasd a YouTube-fiókod.",
|
||||||
|
|||||||
@@ -197,5 +197,6 @@
|
|||||||
"source_not_ready": "A forrásletöltés még nem szerkeszthető.",
|
"source_not_ready": "A forrásletöltés még nem szerkeszthető.",
|
||||||
"generic": "Ezt a vágást nem sikerült létrehozni."
|
"generic": "Ezt a vágást nem sikerült létrehozni."
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"actionFailed": "A letöltési művelet sikertelen"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,8 @@
|
|||||||
"imported": "Importálva a Plexből: {{watched}} megnézve, {{in_progress}} folyamatban.",
|
"imported": "Importálva a Plexből: {{watched}} megnézve, {{in_progress}} folyamatban.",
|
||||||
"lastSync": "Utolsó import: {{when}}",
|
"lastSync": "Utolsó import: {{when}}",
|
||||||
"never": "Még nincs importálva",
|
"never": "Még nincs importálva",
|
||||||
"importing": "Plex-előzmény importálása…"
|
"importing": "Plex-előzmény importálása…",
|
||||||
|
"failed": "A Plex-megtekintés szinkron sikertelen"
|
||||||
},
|
},
|
||||||
"save": {
|
"save": {
|
||||||
"saving": "Mentés…",
|
"saving": "Mentés…",
|
||||||
|
|||||||
Reference in New Issue
Block a user