From ab05d1d6e6e605b250f168c2d5943823c668b4d0 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Sun, 20 Sep 2020 14:47:29 -0500 Subject: [PATCH] =?UTF-8?q?fix(web):=20=F0=9F=90=9B=20show=20mirror=20subs?= =?UTF-8?q?cribe=20links?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref #1958 --- web/src/components/SubscribeButtons.tsx | 11 +++++------ .../components/listInfoDrawer/ListInfoDrawer.tsx | 14 ++++++-------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/web/src/components/SubscribeButtons.tsx b/web/src/components/SubscribeButtons.tsx index 6e37ac1d0..f5072e9f1 100644 --- a/web/src/components/SubscribeButtons.tsx +++ b/web/src/components/SubscribeButtons.tsx @@ -5,25 +5,24 @@ import React from "react"; interface Props { name: string; - viewUrl: string; - viewUrlMirrors: string[]; + viewUrls: string[]; } export const SubscribeButtons = (props: Props) => - props.viewUrl ? ( + props.viewUrls.length ? ( <> - + ) : null; interface MirrorButtonsProps { name: string; - viewUrlMirrors: string[]; + viewUrlMirrors: string[] | undefined; } const MirrorButtons = (props: MirrorButtonsProps) => ( diff --git a/web/src/components/listInfoDrawer/ListInfoDrawer.tsx b/web/src/components/listInfoDrawer/ListInfoDrawer.tsx index ce003dec9..e5d204315 100644 --- a/web/src/components/listInfoDrawer/ListInfoDrawer.tsx +++ b/web/src/components/listInfoDrawer/ListInfoDrawer.tsx @@ -72,9 +72,8 @@ export const ListInfoDrawer = (props: RouteComponentProps & Props) => { document.title = originalTitle; }; }, [list, originalTitle, listName]); - const viewUrl = list?.viewUrls.find( - (u) => u.primariness === 1 && u.segmentNumber === 1 - )?.url; + const viewUrlModels = list?.viewUrls.filter((u) => u.segmentNumber === 1); + const viewUrls = viewUrlModels == null ? [] : viewUrlModels.map(u => u.url); return list ? ( { - {viewUrl && ( + {viewUrls.length && ( )} - {viewUrl && ( + {viewUrlModels && ( }