Live wall: pinned/docked cameras stop when their provider is switched off; admin-only empty-state CTA
- LiveView: localStorage pins carry image URLs, so they rendered (without credit) after an admin disabled the provider. Pins now show only while their provider is serving (server-26#198 licence gating). - MapView: pinned/docked map players drop out once their provider leaves the serving list; credits are kept from the last answer so docked players keep attribution while the overlay is hidden. - WallPanels: the "no camera provider enabled" link to /admin was a dead CTA for non-admins (bounced to /). Link shown to admins only, deep-linked to /admin#cameras; the admin page now honours a tab hash. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
af00139079
commit
e6b1581139
@@ -564,8 +564,16 @@ function DotCameraLayer({ onOpenCamera }: { onOpenCamera?: (c: Camera) => void }
|
||||
const shown = useOverlayShown(map, OVERLAY_DOT_CAMERAS);
|
||||
const zoom = useMapZoom(map);
|
||||
const { data, error, loaded } = useMapCameras(map, shown);
|
||||
const [open, setOpen] = useState<OpenCamera[]>([]);
|
||||
const feeds = useMemo(() => creditsByProvider(data.providers), [data.providers]);
|
||||
const [openAll, setOpen] = useState<OpenCamera[]>([]);
|
||||
// Credits from the last answer received while the overlay was on. Hiding the
|
||||
// overlay empties `data`, but docked players stay up and still need their
|
||||
// attribution. A pinned/docked camera whose provider an admin has since
|
||||
// switched off (licence gating, server-26#198) drops out on the next answer.
|
||||
const [feeds, setFeeds] = useState<Map<string, CameraProviderFeed>>(() => new Map());
|
||||
useEffect(() => {
|
||||
if (shown && loaded) setFeeds(creditsByProvider(data.providers));
|
||||
}, [shown, loaded, data.providers]);
|
||||
const open = useMemo(() => openAll.filter((o) => feeds.has(o.cam.provider)), [openAll, feeds]);
|
||||
|
||||
const pinnedIds = useMemo(() => new Set(open.filter((o) => o.mode === "pin").map((o) => o.cam.id)), [open]);
|
||||
const cells = useMemo(
|
||||
|
||||
Reference in New Issue
Block a user