pstream is dead; long live pstream taciturnaxolotl.github.io/pstream-ng/
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

hide WatchPartyInputLink if backend requirement isnt met

Pas 2c9015dd 3cc98ebd

+14 -1
+14 -1
src/components/LinksDropdown.tsx
··· 2 2 import { useCallback, useEffect, useMemo, useState } from "react"; 3 3 import { useTranslation } from "react-i18next"; 4 4 import { useNavigate } from "react-router-dom"; 5 + import { useAsync } from "react-use"; 5 6 6 7 import { base64ToBuffer, decryptData } from "@/backend/accounts/crypto"; 8 + import { getBackendMeta } from "@/backend/accounts/meta"; 7 9 import { getRoomStatuses } from "@/backend/player/status"; 8 10 import { UserAvatar } from "@/components/Avatar"; 9 11 import { Icon, Icons } from "@/components/Icon"; ··· 213 215 [seed], 214 216 ); 215 217 const { logout } = useAuth(); 218 + const backendUrl = useBackendUrl(); 219 + 220 + // Check backend compatibility for watch party 221 + const backendMeta = useAsync(async () => { 222 + if (!backendUrl) return; 223 + return getBackendMeta(backendUrl); 224 + }, [backendUrl]); 225 + 226 + const backendSupportsWatchParty = backendMeta?.value?.version 227 + ? backendMeta.value.version >= "2.0.1" 228 + : false; 216 229 217 230 useEffect(() => { 218 231 function onWindowClick(evt: MouseEvent) { ··· 291 304 {t("navigation.menu.discover")} 292 305 </DropdownLink> 293 306 )} 294 - <WatchPartyInputLink /> 307 + {backendSupportsWatchParty && <WatchPartyInputLink />} 295 308 {deviceName ? ( 296 309 <DropdownLink 297 310 className="!text-type-danger opacity-75 hover:opacity-100"