fix: make timeline activation durable and visible

This commit is contained in:
ekklesia
2026-09-29 18:15:08 -05:00
parent 92bef4c7aa
commit 5760059ee3
5 changed files with 156 additions and 11 deletions
+17 -8
View File
@@ -62,6 +62,10 @@ export function SignageDashboard({
const selectedGroupId =
groupId ?? (groups.state.status === "ready" ? groups.state.value?.groups[0]?.id : undefined);
const selectedGroup =
groups.state.status === "ready"
? groups.state.value?.groups.find((candidate) => candidate.id === selectedGroupId)
: undefined;
return (
<>
@@ -93,18 +97,23 @@ export function SignageDashboard({
{
content: (
<TimelinesPanel
{...(selectedGroup
? {
activeGroupName: selectedGroup.name,
activeTimelineId: selectedGroup.playback.activeTimelineId,
}
: {})}
api={api}
canManage={mayManageTimelines}
onActivate={
mayControl && selectedGroupId !== undefined
? (timelineId) => {
void api
.send("POST", `playback/${selectedGroupId}/activate`, {
timelineId,
when: "now",
})
.then(() => setTab("playback"))
.catch(() => setTab("playback"));
? async (timelineId) => {
await api.send("POST", `playback/${selectedGroupId}/activate`, {
timelineId,
when: "now",
});
groups.reload();
setTab("playback");
}
: undefined
}