fix(notifications): a notice value is no plain string, so a translated name cannot freeze in one language
A name goes in as raw(), a translated word as its own msg(): tsc now lists every value, and the ones that froze are said when shown — Watch later and an untitled channel in the pin and channel notices, a Plex season's name in its removal toast (a new seasonTitleText, which seasonTitle says).
This commit is contained in:
@@ -34,7 +34,7 @@ import {
|
||||
type Video,
|
||||
type VideoStatus,
|
||||
} from "../../lib/api";
|
||||
import { msg, notify } from "../../lib/notifications";
|
||||
import { msg, notify, raw } from "../../lib/notifications";
|
||||
import { notifyActionError } from "../../lib/actionErrors";
|
||||
import { notifyYouTubeActionError } from "../../lib/youtubeErrors";
|
||||
import { playlistName, playlistNameText } from "../../lib/playlistName";
|
||||
@@ -545,7 +545,7 @@ function PlaylistDetail() {
|
||||
}
|
||||
notify({
|
||||
level: "success",
|
||||
message: msg("playlists.removedToast", { title: video.title ?? "" }),
|
||||
message: msg("playlists.removedToast", { title: raw(video.title ?? "") }),
|
||||
action: {
|
||||
label: t("common.undo"),
|
||||
// ONE request that puts it back at its index (the server renumbers around it): an append
|
||||
@@ -630,7 +630,7 @@ function PlaylistDetail() {
|
||||
setLastMoveTargetId(target.id);
|
||||
notify({
|
||||
level: "success",
|
||||
message: msg("playlists.movedToast", { title, name: playlistNameText(target) }),
|
||||
message: msg("playlists.movedToast", { title: raw(title), name: playlistNameText(target) }),
|
||||
});
|
||||
} catch (e) {
|
||||
// NOT a silent revert. `req` deliberately leaves 401/403/404 to the caller as control flow, and
|
||||
@@ -731,7 +731,7 @@ function PlaylistDetail() {
|
||||
icon: <Play className="w-4 h-4" />,
|
||||
onSelect: () => openPlayer(ctxRow.id),
|
||||
},
|
||||
...comfortPin.item(pinVideo(ctxRow.id), ctxRow.title ?? ""),
|
||||
...comfortPin.item(pinVideo(ctxRow.id), raw(ctxRow.title ?? "")),
|
||||
...copy(ctxRow.title, ctxRow.watch_url).map((it, i) => ({
|
||||
...it,
|
||||
separatorBefore: i === 0,
|
||||
@@ -806,7 +806,7 @@ function PlaylistDetail() {
|
||||
setRenameValue(headerPl.name);
|
||||
setRenaming(true);
|
||||
},
|
||||
pin: headerPin.item(pinPlaylist(headerPl.id), plName(headerPl)),
|
||||
pin: headerPin.item(pinPlaylist(headerPl.id), playlistNameText(headerPl)),
|
||||
});
|
||||
|
||||
// The page's background menu mirrors the band: Play all, the view controls, the order's undo, and
|
||||
@@ -855,7 +855,7 @@ function PlaylistDetail() {
|
||||
setRenameValue(detail.name);
|
||||
setRenaming(true);
|
||||
},
|
||||
pin: pagePin.item(pinPlaylist(detail.id), plName(detail)),
|
||||
pin: pagePin.item(pinPlaylist(detail.id), playlistNameText(detail)),
|
||||
})
|
||||
.filter((it) => !("danger" in it && it.danger)),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user