social-app feed support bsky.social
This commit is contained in:
@@ -39,7 +39,7 @@ index 77f219e55..53f5e0cc0 100644
|
|||||||
. You have been sent an email outlining the specific violation
|
. You have been sent an email outlining the specific violation
|
||||||
and suspension period, if applicable. You can appeal this
|
and suspension period, if applicable. You can appeal this
|
||||||
diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx
|
diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx
|
||||||
index e058e2883..7a355cf6c 100644
|
index e058e2883..8daf41089 100644
|
||||||
--- a/src/view/screens/Home.tsx
|
--- a/src/view/screens/Home.tsx
|
||||||
+++ b/src/view/screens/Home.tsx
|
+++ b/src/view/screens/Home.tsx
|
||||||
@@ -1,23 +1,16 @@
|
@@ -1,23 +1,16 @@
|
||||||
@@ -81,7 +81,7 @@ index e058e2883..7a355cf6c 100644
|
|||||||
import {CustomFeedEmptyState} from '#/view/com/posts/CustomFeedEmptyState'
|
import {CustomFeedEmptyState} from '#/view/com/posts/CustomFeedEmptyState'
|
||||||
import {FollowingEmptyState} from '#/view/com/posts/FollowingEmptyState'
|
import {FollowingEmptyState} from '#/view/com/posts/FollowingEmptyState'
|
||||||
import {FollowingEndOfFeed} from '#/view/com/posts/FollowingEndOfFeed'
|
import {FollowingEndOfFeed} from '#/view/com/posts/FollowingEndOfFeed'
|
||||||
@@ -39,97 +28,87 @@ import {NoFeedsPinned} from '#/screens/Home/NoFeedsPinned'
|
@@ -39,97 +28,90 @@ import {NoFeedsPinned} from '#/screens/Home/NoFeedsPinned'
|
||||||
import * as Layout from '#/components/Layout'
|
import * as Layout from '#/components/Layout'
|
||||||
import {useDemoMode} from '#/storage/hooks/demo-mode'
|
import {useDemoMode} from '#/storage/hooks/demo-mode'
|
||||||
|
|
||||||
@@ -129,8 +129,11 @@ index e058e2883..7a355cf6c 100644
|
|||||||
+ const {data: pinnedFeedInfos} = usePinnedFeedsInfos()
|
+ const {data: pinnedFeedInfos} = usePinnedFeedsInfos()
|
||||||
+
|
+
|
||||||
+ const safePreferences = preferences || { feedViewPrefs: { lab_mergeFeedEnabled: false }, savedFeeds: [] } as any
|
+ const safePreferences = preferences || { feedViewPrefs: { lab_mergeFeedEnabled: false }, savedFeeds: [] } as any
|
||||||
|
+ // Use user's pinned feeds when logged in and available, otherwise use defaults
|
||||||
+ const safePinnedFeedInfos = !currentAccount
|
+ const safePinnedFeedInfos = !currentAccount
|
||||||
+ ? DEFAULT_PINNED_FEEDS.filter(f => f.feedDescriptor !== 'following')
|
+ ? DEFAULT_PINNED_FEEDS.filter(f => f.feedDescriptor !== 'following')
|
||||||
|
+ : (pinnedFeedInfos && pinnedFeedInfos.length > 0)
|
||||||
|
+ ? pinnedFeedInfos
|
||||||
+ : DEFAULT_PINNED_FEEDS
|
+ : DEFAULT_PINNED_FEEDS
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
@@ -233,7 +236,7 @@ index e058e2883..7a355cf6c 100644
|
|||||||
if (selectedIndex !== lastPagerReportedIndexRef.current) {
|
if (selectedIndex !== lastPagerReportedIndexRef.current) {
|
||||||
lastPagerReportedIndexRef.current = selectedIndex
|
lastPagerReportedIndexRef.current = selectedIndex
|
||||||
pagerRef.current?.setPage(selectedIndex)
|
pagerRef.current?.setPage(selectedIndex)
|
||||||
@@ -138,205 +117,43 @@ function HomeScreenReady({
|
@@ -138,205 +120,43 @@ function HomeScreenReady({
|
||||||
|
|
||||||
const {hasSession} = useSession()
|
const {hasSession} = useSession()
|
||||||
const setMinimalShellMode = useSetMinimalShellMode()
|
const setMinimalShellMode = useSetMinimalShellMode()
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
diff --git a/src/components/dialogs/BirthDateSettings.tsx b/src/components/dialogs/BirthDateSettings.tsx
|
diff --git a/src/components/dialogs/BirthDateSettings.tsx b/src/components/dialogs/BirthDateSettings.tsx
|
||||||
index 9915d0a2d..4ae51215d 100644
|
index c5205bf71..3fccb9dfd 100644
|
||||||
--- a/src/components/dialogs/BirthDateSettings.tsx
|
--- a/src/components/dialogs/BirthDateSettings.tsx
|
||||||
+++ b/src/components/dialogs/BirthDateSettings.tsx
|
+++ b/src/components/dialogs/BirthDateSettings.tsx
|
||||||
@@ -163,7 +163,7 @@ function BirthdayInner({
|
@@ -165,7 +165,7 @@ function BirthdayInner({
|
||||||
<Trans>
|
<Trans>
|
||||||
You must be at least 13 years old to use Bluesky. Read our{' '}
|
You must be at least 13 years old to use Bluesky. Read our{' '}
|
||||||
<SimpleInlineLinkText
|
<SimpleInlineLinkText
|
||||||
@@ -12,9 +12,21 @@ index 9915d0a2d..4ae51215d 100644
|
|||||||
Terms of Service
|
Terms of Service
|
||||||
</SimpleInlineLinkText>{' '}
|
</SimpleInlineLinkText>{' '}
|
||||||
diff --git a/src/components/dialogs/ServerInput.tsx b/src/components/dialogs/ServerInput.tsx
|
diff --git a/src/components/dialogs/ServerInput.tsx b/src/components/dialogs/ServerInput.tsx
|
||||||
index d7c02bb9f..fda1dfe4a 100644
|
index d7c02bb9f..99b98781f 100644
|
||||||
--- a/src/components/dialogs/ServerInput.tsx
|
--- a/src/components/dialogs/ServerInput.tsx
|
||||||
+++ b/src/components/dialogs/ServerInput.tsx
|
+++ b/src/components/dialogs/ServerInput.tsx
|
||||||
|
@@ -144,9 +144,9 @@ function DialogInner({
|
||||||
|
<SegmentedControl.Item
|
||||||
|
testID="bskyServiceSelectBtn"
|
||||||
|
value={BSKY_SERVICE}
|
||||||
|
- label={_(msg`Bluesky`)}>
|
||||||
|
+ label={_(msg`syu.is`)}>
|
||||||
|
<SegmentedControl.ItemText>
|
||||||
|
- {_(msg`Bluesky`)}
|
||||||
|
+ {_(msg`syu.is`)}
|
||||||
|
</SegmentedControl.ItemText>
|
||||||
|
</SegmentedControl.Item>
|
||||||
|
<SegmentedControl.Item
|
||||||
@@ -165,7 +165,7 @@ function DialogInner({
|
@@ -165,7 +165,7 @@ function DialogInner({
|
||||||
<Trans>
|
<Trans>
|
||||||
Bluesky is an open network where you can choose your own
|
Bluesky is an open network where you can choose your own
|
||||||
@@ -25,676 +37,24 @@ index d7c02bb9f..fda1dfe4a 100644
|
|||||||
</Admonition>
|
</Admonition>
|
||||||
</View>
|
</View>
|
||||||
diff --git a/src/view/shell/Drawer.tsx b/src/view/shell/Drawer.tsx
|
diff --git a/src/view/shell/Drawer.tsx b/src/view/shell/Drawer.tsx
|
||||||
index ed2a6cfb7..1dc7f9227 100644
|
index f76147ccf..96a2ac337 100644
|
||||||
--- a/src/view/shell/Drawer.tsx
|
--- a/src/view/shell/Drawer.tsx
|
||||||
+++ b/src/view/shell/Drawer.tsx
|
+++ b/src/view/shell/Drawer.tsx
|
||||||
@@ -1,60 +1,50 @@
|
@@ -695,12 +695,12 @@ function ExtraLinks() {
|
||||||
-import React, {type ComponentProps, type JSX} from 'react'
|
<InlineLinkText
|
||||||
-import {Linking, ScrollView, TouchableOpacity, View} from 'react-native'
|
style={[a.text_md]}
|
||||||
-import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
label={_(msg`Terms of Service`)}
|
||||||
-import {msg, Plural, plural, Trans} from '@lingui/macro'
|
|
||||||
-import {useLingui} from '@lingui/react'
|
|
||||||
-import {StackActions, useNavigation} from '@react-navigation/native'
|
|
||||||
-
|
|
||||||
-import {useActorStatus} from '#/lib/actor-status'
|
|
||||||
-import {FEEDBACK_FORM_URL, HELP_DESK_URL} from '#/lib/constants'
|
|
||||||
-import {type PressableScale} from '#/lib/custom-animations/PressableScale'
|
|
||||||
-import {useNavigationTabState} from '#/lib/hooks/useNavigationTabState'
|
|
||||||
-import {getTabState, TabState} from '#/lib/routes/helpers'
|
|
||||||
-import {type NavigationProp} from '#/lib/routes/types'
|
|
||||||
-import {sanitizeHandle} from '#/lib/strings/handles'
|
|
||||||
-import {colors} from '#/lib/styles'
|
|
||||||
-import {isWeb} from '#/platform/detection'
|
|
||||||
-import {emitSoftReset} from '#/state/events'
|
|
||||||
-import {useKawaiiMode} from '#/state/preferences/kawaii'
|
|
||||||
-import {useUnreadNotifications} from '#/state/queries/notifications/unread'
|
|
||||||
-import {useProfileQuery} from '#/state/queries/profile'
|
|
||||||
-import {type SessionAccount, useSession} from '#/state/session'
|
|
||||||
-import {useSetDrawerOpen} from '#/state/shell'
|
|
||||||
-import {formatCount} from '#/view/com/util/numeric/format'
|
|
||||||
-import {UserAvatar} from '#/view/com/util/UserAvatar'
|
|
||||||
-import {NavSignupCard} from '#/view/shell/NavSignupCard'
|
|
||||||
-import {atoms as a, tokens, useTheme, web} from '#/alf'
|
|
||||||
-import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
|
||||||
-import {Divider} from '#/components/Divider'
|
|
||||||
+import React, { type ComponentProps, type JSX } from 'react'
|
|
||||||
+import { Linking, ScrollView, TouchableOpacity, View } from 'react-native'
|
|
||||||
+import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
||||||
+import { msg, Plural, plural, Trans } from '@lingui/macro'
|
|
||||||
+import { useLingui } from '@lingui/react'
|
|
||||||
+import { StackActions, useNavigation } from '@react-navigation/native'
|
|
||||||
+
|
|
||||||
+import { useActorStatus } from '#/lib/actor-status'
|
|
||||||
+import { FEEDBACK_FORM_URL, HELP_DESK_URL } from '#/lib/constants'
|
|
||||||
+import { type PressableScale } from '#/lib/custom-animations/PressableScale'
|
|
||||||
+import { useNavigationTabState } from '#/lib/hooks/useNavigationTabState'
|
|
||||||
+import { getTabState, TabState } from '#/lib/routes/helpers'
|
|
||||||
+import { type NavigationProp } from '#/lib/routes/types'
|
|
||||||
+import { sanitizeHandle } from '#/lib/strings/handles'
|
|
||||||
+import { colors } from '#/lib/styles'
|
|
||||||
+import { isWeb } from '#/platform/detection'
|
|
||||||
+import { emitSoftReset } from '#/state/events'
|
|
||||||
+import { useKawaiiMode } from '#/state/preferences/kawaii'
|
|
||||||
+import { useUnreadNotifications } from '#/state/queries/notifications/unread'
|
|
||||||
+import { useProfileQuery } from '#/state/queries/profile'
|
|
||||||
+import { type SessionAccount, useSession } from '#/state/session'
|
|
||||||
+import { useSetDrawerOpen } from '#/state/shell'
|
|
||||||
+import { formatCount } from '#/view/com/util/numeric/format'
|
|
||||||
+import { UserAvatar } from '#/view/com/util/UserAvatar'
|
|
||||||
+import { NavSignupCard } from '#/view/shell/NavSignupCard'
|
|
||||||
+import { atoms as a, tokens, useTheme, web } from '#/alf'
|
|
||||||
+import { Button } from '#/components/Button'
|
|
||||||
+import { Divider } from '#/components/Divider'
|
|
||||||
import {
|
|
||||||
Bell_Filled_Corner0_Rounded as BellFilled,
|
|
||||||
Bell_Stroke2_Corner0_Rounded as Bell,
|
|
||||||
} from '#/components/icons/Bell'
|
|
||||||
-import {Bookmark, BookmarkFilled} from '#/components/icons/Bookmark'
|
|
||||||
-import {BulletList_Stroke2_Corner0_Rounded as List} from '#/components/icons/BulletList'
|
|
||||||
-import {
|
|
||||||
- Hashtag_Filled_Corner0_Rounded as HashtagFilled,
|
|
||||||
- Hashtag_Stroke2_Corner0_Rounded as Hashtag,
|
|
||||||
-} from '#/components/icons/Hashtag'
|
|
||||||
import {
|
|
||||||
HomeOpen_Filled_Corner0_Rounded as HomeFilled,
|
|
||||||
HomeOpen_Stoke2_Corner0_Rounded as Home,
|
|
||||||
} from '#/components/icons/HomeOpen'
|
|
||||||
-import {MagnifyingGlass_Filled_Stroke2_Corner0_Rounded as MagnifyingGlassFilled} from '#/components/icons/MagnifyingGlass'
|
|
||||||
-import {MagnifyingGlass2_Stroke2_Corner0_Rounded as MagnifyingGlass} from '#/components/icons/MagnifyingGlass2'
|
|
||||||
-import {
|
|
||||||
- Message_Stroke2_Corner0_Rounded as Message,
|
|
||||||
- Message_Stroke2_Corner0_Rounded_Filled as MessageFilled,
|
|
||||||
-} from '#/components/icons/Message'
|
|
||||||
-import {SettingsGear2_Stroke2_Corner0_Rounded as Settings} from '#/components/icons/SettingsGear2'
|
|
||||||
+import { MagnifyingGlass_Filled_Stroke2_Corner0_Rounded as MagnifyingGlassFilled } from '#/components/icons/MagnifyingGlass'
|
|
||||||
+import { MagnifyingGlass2_Stroke2_Corner0_Rounded as MagnifyingGlass } from '#/components/icons/MagnifyingGlass2'
|
|
||||||
+import { SettingsGear2_Stroke2_Corner0_Rounded as Settings } from '#/components/icons/SettingsGear2'
|
|
||||||
import {
|
|
||||||
UserCircle_Filled_Corner0_Rounded as UserCircleFilled,
|
|
||||||
UserCircle_Stroke2_Corner0_Rounded as UserCircle,
|
|
||||||
} from '#/components/icons/UserCircle'
|
|
||||||
-import {InlineLinkText} from '#/components/Link'
|
|
||||||
-import {Text} from '#/components/Typography'
|
|
||||||
-import {useSimpleVerificationState} from '#/components/verification'
|
|
||||||
-import {VerificationCheck} from '#/components/verification/VerificationCheck'
|
|
||||||
+import { InlineLinkText } from '#/components/Link'
|
|
||||||
+import { Text } from '#/components/Typography'
|
|
||||||
+import { useSimpleVerificationState } from '#/components/verification'
|
|
||||||
+import { VerificationCheck } from '#/components/verification/VerificationCheck'
|
|
||||||
|
|
||||||
const iconWidth = 26
|
|
||||||
|
|
||||||
@@ -65,11 +55,11 @@ let DrawerProfileCard = ({
|
|
||||||
account: SessionAccount
|
|
||||||
onPressProfile: () => void
|
|
||||||
}): React.ReactNode => {
|
|
||||||
- const {_, i18n} = useLingui()
|
|
||||||
+ const { _, i18n } = useLingui()
|
|
||||||
const t = useTheme()
|
|
||||||
- const {data: profile} = useProfileQuery({did: account.did})
|
|
||||||
- const verification = useSimpleVerificationState({profile})
|
|
||||||
- const {isActive: live} = useActorStatus(profile)
|
|
||||||
+ const { data: profile } = useProfileQuery({ did: account.did })
|
|
||||||
+ const verification = useSimpleVerificationState({ profile })
|
|
||||||
+ const { isActive: live } = useActorStatus(profile)
|
|
||||||
|
|
||||||
return (
|
|
||||||
<TouchableOpacity
|
|
||||||
@@ -81,7 +71,6 @@ let DrawerProfileCard = ({
|
|
||||||
<UserAvatar
|
|
||||||
size={52}
|
|
||||||
avatar={profile?.avatar}
|
|
||||||
- // See https://github.com/bluesky-social/social-app/pull/1801:
|
|
||||||
usePlainRNImage={true}
|
|
||||||
type={profile?.associated?.labeler ? 'labeler' : 'user'}
|
|
||||||
live={live}
|
|
||||||
@@ -140,9 +129,9 @@ let DrawerProfileCard = ({
|
|
||||||
)
|
|
||||||
}
|
|
||||||
DrawerProfileCard = React.memo(DrawerProfileCard)
|
|
||||||
-export {DrawerProfileCard}
|
|
||||||
+export { DrawerProfileCard }
|
|
||||||
|
|
||||||
-let DrawerContent = ({}: React.PropsWithoutRef<{}>): React.ReactNode => {
|
|
||||||
+let DrawerContent = ({ }: React.PropsWithoutRef<{}>): React.ReactNode => {
|
|
||||||
const t = useTheme()
|
|
||||||
const insets = useSafeAreaInsets()
|
|
||||||
const setDrawerOpen = useSetDrawerOpen()
|
|
||||||
@@ -150,27 +139,20 @@ let DrawerContent = ({}: React.PropsWithoutRef<{}>): React.ReactNode => {
|
|
||||||
const {
|
|
||||||
isAtHome,
|
|
||||||
isAtSearch,
|
|
||||||
- isAtFeeds,
|
|
||||||
- isAtBookmarks,
|
|
||||||
isAtNotifications,
|
|
||||||
isAtMyProfile,
|
|
||||||
- isAtMessages,
|
|
||||||
} = useNavigationTabState()
|
|
||||||
- const {hasSession, currentAccount} = useSession()
|
|
||||||
-
|
|
||||||
- // events
|
|
||||||
- // =
|
|
||||||
+ const { hasSession, currentAccount } = useSession()
|
|
||||||
|
|
||||||
const onPressTab = React.useCallback(
|
|
||||||
(tab: 'Home' | 'Search' | 'Messages' | 'Notifications' | 'MyProfile') => {
|
|
||||||
const state = navigation.getState()
|
|
||||||
setDrawerOpen(false)
|
|
||||||
if (isWeb) {
|
|
||||||
- // hack because we have flat navigator for web and MyProfile does not exist on the web navigator -ansh
|
|
||||||
if (tab === 'MyProfile') {
|
|
||||||
- navigation.navigate('Profile', {name: currentAccount!.handle})
|
|
||||||
+ navigation.navigate('Profile', { name: currentAccount!.handle })
|
|
||||||
} else {
|
|
||||||
- // @ts-expect-error struggles with string unions, apparently
|
|
||||||
+ // @ts-expect-error struggles with string unions
|
|
||||||
navigation.navigate(tab)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
@@ -178,21 +160,11 @@ let DrawerContent = ({}: React.PropsWithoutRef<{}>): React.ReactNode => {
|
|
||||||
if (tabState === TabState.InsideAtRoot) {
|
|
||||||
emitSoftReset()
|
|
||||||
} else if (tabState === TabState.Inside) {
|
|
||||||
- // find the correct navigator in which to pop-to-top
|
|
||||||
- const target = state.routes.find(route => route.name === `${tab}Tab`)
|
|
||||||
- ?.state?.key
|
|
||||||
+ const target = state.routes.find(route => route.name === `${tab}Tab`)?.state?.key
|
|
||||||
if (target) {
|
|
||||||
- // if we found it, trigger pop-to-top
|
|
||||||
- navigation.dispatch({
|
|
||||||
- ...StackActions.popToTop(),
|
|
||||||
- target,
|
|
||||||
- })
|
|
||||||
+ navigation.dispatch({ ...StackActions.popToTop(), target })
|
|
||||||
} else {
|
|
||||||
- // fallback: reset navigation
|
|
||||||
- navigation.reset({
|
|
||||||
- index: 0,
|
|
||||||
- routes: [{name: `${tab}Tab`}],
|
|
||||||
- })
|
|
||||||
+ navigation.reset({ index: 0, routes: [{ name: `${tab}Tab` }] })
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
navigation.navigate(`${tab}Tab`)
|
|
||||||
@@ -203,76 +175,21 @@ let DrawerContent = ({}: React.PropsWithoutRef<{}>): React.ReactNode => {
|
|
||||||
)
|
|
||||||
|
|
||||||
const onPressHome = React.useCallback(() => onPressTab('Home'), [onPressTab])
|
|
||||||
-
|
|
||||||
- const onPressSearch = React.useCallback(
|
|
||||||
- () => onPressTab('Search'),
|
|
||||||
- [onPressTab],
|
|
||||||
- )
|
|
||||||
-
|
|
||||||
- const onPressMessages = React.useCallback(
|
|
||||||
- () => onPressTab('Messages'),
|
|
||||||
- [onPressTab],
|
|
||||||
- )
|
|
||||||
-
|
|
||||||
- const onPressNotifications = React.useCallback(
|
|
||||||
- () => onPressTab('Notifications'),
|
|
||||||
- [onPressTab],
|
|
||||||
- )
|
|
||||||
-
|
|
||||||
- const onPressProfile = React.useCallback(() => {
|
|
||||||
- onPressTab('MyProfile')
|
|
||||||
- }, [onPressTab])
|
|
||||||
-
|
|
||||||
- const onPressMyFeeds = React.useCallback(() => {
|
|
||||||
- navigation.navigate('Feeds')
|
|
||||||
- setDrawerOpen(false)
|
|
||||||
- }, [navigation, setDrawerOpen])
|
|
||||||
-
|
|
||||||
- const onPressLists = React.useCallback(() => {
|
|
||||||
- navigation.navigate('Lists')
|
|
||||||
- setDrawerOpen(false)
|
|
||||||
- }, [navigation, setDrawerOpen])
|
|
||||||
-
|
|
||||||
- const onPressBookmarks = React.useCallback(() => {
|
|
||||||
- navigation.navigate('Bookmarks')
|
|
||||||
- setDrawerOpen(false)
|
|
||||||
- }, [navigation, setDrawerOpen])
|
|
||||||
-
|
|
||||||
+ const onPressSearch = React.useCallback(() => onPressTab('Search'), [onPressTab])
|
|
||||||
+ const onPressNotifications = React.useCallback(() => onPressTab('Notifications'), [onPressTab])
|
|
||||||
+ const onPressProfile = React.useCallback(() => { onPressTab('MyProfile') }, [onPressTab])
|
|
||||||
const onPressSettings = React.useCallback(() => {
|
|
||||||
navigation.navigate('Settings')
|
|
||||||
setDrawerOpen(false)
|
|
||||||
}, [navigation, setDrawerOpen])
|
|
||||||
|
|
||||||
- const onPressFeedback = React.useCallback(() => {
|
|
||||||
- Linking.openURL(
|
|
||||||
- FEEDBACK_FORM_URL({
|
|
||||||
- email: currentAccount?.email,
|
|
||||||
- handle: currentAccount?.handle,
|
|
||||||
- }),
|
|
||||||
- )
|
|
||||||
- }, [currentAccount])
|
|
||||||
-
|
|
||||||
- const onPressHelp = React.useCallback(() => {
|
|
||||||
- Linking.openURL(HELP_DESK_URL)
|
|
||||||
- }, [])
|
|
||||||
-
|
|
||||||
- // rendering
|
|
||||||
- // =
|
|
||||||
-
|
|
||||||
return (
|
|
||||||
<View
|
|
||||||
testID="drawer"
|
|
||||||
style={[a.flex_1, a.border_r, t.atoms.bg, t.atoms.border_contrast_low]}>
|
|
||||||
<ScrollView
|
|
||||||
style={[a.flex_1]}
|
|
||||||
- contentContainerStyle={[
|
|
||||||
- {
|
|
||||||
- paddingTop: Math.max(
|
|
||||||
- insets.top + a.pt_xl.paddingTop,
|
|
||||||
- a.pt_xl.paddingTop,
|
|
||||||
- ),
|
|
||||||
- },
|
|
||||||
- ]}>
|
|
||||||
+ contentContainerStyle={[{ paddingTop: Math.max(insets.top + a.pt_xl.paddingTop, a.pt_xl.paddingTop) }]}>
|
|
||||||
<View style={[a.px_xl]}>
|
|
||||||
{hasSession && currentAccount ? (
|
|
||||||
<DrawerProfileCard
|
|
||||||
@@ -284,7 +201,6 @@ let DrawerContent = ({}: React.PropsWithoutRef<{}>): React.ReactNode => {
|
|
||||||
<NavSignupCard />
|
|
||||||
</View>
|
|
||||||
)}
|
|
||||||
-
|
|
||||||
<Divider style={[a.mt_xl, a.mb_sm]} />
|
|
||||||
</View>
|
|
||||||
|
|
||||||
@@ -292,17 +208,10 @@ let DrawerContent = ({}: React.PropsWithoutRef<{}>): React.ReactNode => {
|
|
||||||
<>
|
|
||||||
<SearchMenuItem isActive={isAtSearch} onPress={onPressSearch} />
|
|
||||||
<HomeMenuItem isActive={isAtHome} onPress={onPressHome} />
|
|
||||||
- <ChatMenuItem isActive={isAtMessages} onPress={onPressMessages} />
|
|
||||||
<NotificationsMenuItem
|
|
||||||
isActive={isAtNotifications}
|
|
||||||
onPress={onPressNotifications}
|
|
||||||
/>
|
|
||||||
- <FeedsMenuItem isActive={isAtFeeds} onPress={onPressMyFeeds} />
|
|
||||||
- <ListsMenuItem onPress={onPressLists} />
|
|
||||||
- <BookmarksMenuItem
|
|
||||||
- isActive={isAtBookmarks}
|
|
||||||
- onPress={onPressBookmarks}
|
|
||||||
- />
|
|
||||||
<ProfileMenuItem
|
|
||||||
isActive={isAtMyProfile}
|
|
||||||
onPress={onPressProfile}
|
|
||||||
@@ -312,7 +221,6 @@ let DrawerContent = ({}: React.PropsWithoutRef<{}>): React.ReactNode => {
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
<HomeMenuItem isActive={isAtHome} onPress={onPressHome} />
|
|
||||||
- <FeedsMenuItem isActive={isAtFeeds} onPress={onPressMyFeeds} />
|
|
||||||
<SearchMenuItem isActive={isAtSearch} onPress={onPressSearch} />
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
@@ -322,69 +230,11 @@ let DrawerContent = ({}: React.PropsWithoutRef<{}>): React.ReactNode => {
|
|
||||||
<ExtraLinks />
|
|
||||||
</View>
|
|
||||||
</ScrollView>
|
|
||||||
-
|
|
||||||
- <DrawerFooter
|
|
||||||
- onPressFeedback={onPressFeedback}
|
|
||||||
- onPressHelp={onPressHelp}
|
|
||||||
- />
|
|
||||||
</View>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
DrawerContent = React.memo(DrawerContent)
|
|
||||||
-export {DrawerContent}
|
|
||||||
-
|
|
||||||
-let DrawerFooter = ({
|
|
||||||
- onPressFeedback,
|
|
||||||
- onPressHelp,
|
|
||||||
-}: {
|
|
||||||
- onPressFeedback: () => void
|
|
||||||
- onPressHelp: () => void
|
|
||||||
-}): React.ReactNode => {
|
|
||||||
- const {_} = useLingui()
|
|
||||||
- const insets = useSafeAreaInsets()
|
|
||||||
- return (
|
|
||||||
- <View
|
|
||||||
- style={[
|
|
||||||
- a.flex_row,
|
|
||||||
- a.gap_sm,
|
|
||||||
- a.flex_wrap,
|
|
||||||
- a.pl_xl,
|
|
||||||
- a.pt_md,
|
|
||||||
- {
|
|
||||||
- paddingBottom: Math.max(
|
|
||||||
- insets.bottom + tokens.space.xs,
|
|
||||||
- tokens.space.xl,
|
|
||||||
- ),
|
|
||||||
- },
|
|
||||||
- ]}>
|
|
||||||
- <Button
|
|
||||||
- label={_(msg`Send feedback`)}
|
|
||||||
- size="small"
|
|
||||||
- variant="solid"
|
|
||||||
- color="secondary"
|
|
||||||
- onPress={onPressFeedback}>
|
|
||||||
- <ButtonIcon icon={Message} position="left" />
|
|
||||||
- <ButtonText>
|
|
||||||
- <Trans>Feedback</Trans>
|
|
||||||
- </ButtonText>
|
|
||||||
- </Button>
|
|
||||||
- <Button
|
|
||||||
- label={_(msg`Get help`)}
|
|
||||||
- size="small"
|
|
||||||
- variant="outline"
|
|
||||||
- color="secondary"
|
|
||||||
- onPress={onPressHelp}
|
|
||||||
- style={{
|
|
||||||
- backgroundColor: 'transparent',
|
|
||||||
- }}>
|
|
||||||
- <ButtonText>
|
|
||||||
- <Trans>Help</Trans>
|
|
||||||
- </ButtonText>
|
|
||||||
- </Button>
|
|
||||||
- </View>
|
|
||||||
- )
|
|
||||||
-}
|
|
||||||
-DrawerFooter = React.memo(DrawerFooter)
|
|
||||||
+export { DrawerContent }
|
|
||||||
|
|
||||||
interface MenuItemProps extends ComponentProps<typeof PressableScale> {
|
|
||||||
icon: JSX.Element
|
|
||||||
@@ -400,7 +250,7 @@ let SearchMenuItem = ({
|
|
||||||
isActive: boolean
|
|
||||||
onPress: () => void
|
|
||||||
}): React.ReactNode => {
|
|
||||||
- const {_} = useLingui()
|
|
||||||
+ const { _ } = useLingui()
|
|
||||||
const t = useTheme()
|
|
||||||
return (
|
|
||||||
<MenuItem
|
|
||||||
@@ -426,7 +276,7 @@ let HomeMenuItem = ({
|
|
||||||
isActive: boolean
|
|
||||||
onPress: () => void
|
|
||||||
}): React.ReactNode => {
|
|
||||||
- const {_} = useLingui()
|
|
||||||
+ const { _ } = useLingui()
|
|
||||||
const t = useTheme()
|
|
||||||
return (
|
|
||||||
<MenuItem
|
|
||||||
@@ -445,32 +295,6 @@ let HomeMenuItem = ({
|
|
||||||
}
|
|
||||||
HomeMenuItem = React.memo(HomeMenuItem)
|
|
||||||
|
|
||||||
-let ChatMenuItem = ({
|
|
||||||
- isActive,
|
|
||||||
- onPress,
|
|
||||||
-}: {
|
|
||||||
- isActive: boolean
|
|
||||||
- onPress: () => void
|
|
||||||
-}): React.ReactNode => {
|
|
||||||
- const {_} = useLingui()
|
|
||||||
- const t = useTheme()
|
|
||||||
- return (
|
|
||||||
- <MenuItem
|
|
||||||
- icon={
|
|
||||||
- isActive ? (
|
|
||||||
- <MessageFilled style={[t.atoms.text]} width={iconWidth} />
|
|
||||||
- ) : (
|
|
||||||
- <Message style={[t.atoms.text]} width={iconWidth} />
|
|
||||||
- )
|
|
||||||
- }
|
|
||||||
- label={_(msg`Chat`)}
|
|
||||||
- bold={isActive}
|
|
||||||
- onPress={onPress}
|
|
||||||
- />
|
|
||||||
- )
|
|
||||||
-}
|
|
||||||
-ChatMenuItem = React.memo(ChatMenuItem)
|
|
||||||
-
|
|
||||||
let NotificationsMenuItem = ({
|
|
||||||
isActive,
|
|
||||||
onPress,
|
|
||||||
@@ -478,7 +302,7 @@ let NotificationsMenuItem = ({
|
|
||||||
isActive: boolean
|
|
||||||
onPress: () => void
|
|
||||||
}): React.ReactNode => {
|
|
||||||
- const {_} = useLingui()
|
|
||||||
+ const { _ } = useLingui()
|
|
||||||
const t = useTheme()
|
|
||||||
const numUnreadNotifications = useUnreadNotifications()
|
|
||||||
return (
|
|
||||||
@@ -495,11 +319,11 @@ let NotificationsMenuItem = ({
|
|
||||||
numUnreadNotifications === ''
|
|
||||||
? ''
|
|
||||||
: _(
|
|
||||||
- msg`${plural(numUnreadNotifications ?? 0, {
|
|
||||||
- one: '# unread item',
|
|
||||||
- other: '# unread items',
|
|
||||||
- })}` || '',
|
|
||||||
- )
|
|
||||||
+ msg`${plural(numUnreadNotifications ?? 0, {
|
|
||||||
+ one: '# unread item',
|
|
||||||
+ other: '# unread items',
|
|
||||||
+ })}` || '',
|
|
||||||
+ )
|
|
||||||
}
|
|
||||||
count={numUnreadNotifications}
|
|
||||||
bold={isActive}
|
|
||||||
@@ -509,72 +333,6 @@ let NotificationsMenuItem = ({
|
|
||||||
}
|
|
||||||
NotificationsMenuItem = React.memo(NotificationsMenuItem)
|
|
||||||
|
|
||||||
-let FeedsMenuItem = ({
|
|
||||||
- isActive,
|
|
||||||
- onPress,
|
|
||||||
-}: {
|
|
||||||
- isActive: boolean
|
|
||||||
- onPress: () => void
|
|
||||||
-}): React.ReactNode => {
|
|
||||||
- const {_} = useLingui()
|
|
||||||
- const t = useTheme()
|
|
||||||
- return (
|
|
||||||
- <MenuItem
|
|
||||||
- icon={
|
|
||||||
- isActive ? (
|
|
||||||
- <HashtagFilled width={iconWidth} style={[t.atoms.text]} />
|
|
||||||
- ) : (
|
|
||||||
- <Hashtag width={iconWidth} style={[t.atoms.text]} />
|
|
||||||
- )
|
|
||||||
- }
|
|
||||||
- label={_(msg`Feeds`)}
|
|
||||||
- bold={isActive}
|
|
||||||
- onPress={onPress}
|
|
||||||
- />
|
|
||||||
- )
|
|
||||||
-}
|
|
||||||
-FeedsMenuItem = React.memo(FeedsMenuItem)
|
|
||||||
-
|
|
||||||
-let ListsMenuItem = ({onPress}: {onPress: () => void}): React.ReactNode => {
|
|
||||||
- const {_} = useLingui()
|
|
||||||
- const t = useTheme()
|
|
||||||
-
|
|
||||||
- return (
|
|
||||||
- <MenuItem
|
|
||||||
- icon={<List style={[t.atoms.text]} width={iconWidth} />}
|
|
||||||
- label={_(msg`Lists`)}
|
|
||||||
- onPress={onPress}
|
|
||||||
- />
|
|
||||||
- )
|
|
||||||
-}
|
|
||||||
-ListsMenuItem = React.memo(ListsMenuItem)
|
|
||||||
-
|
|
||||||
-let BookmarksMenuItem = ({
|
|
||||||
- isActive,
|
|
||||||
- onPress,
|
|
||||||
-}: {
|
|
||||||
- isActive: boolean
|
|
||||||
- onPress: () => void
|
|
||||||
-}): React.ReactNode => {
|
|
||||||
- const {_} = useLingui()
|
|
||||||
- const t = useTheme()
|
|
||||||
-
|
|
||||||
- return (
|
|
||||||
- <MenuItem
|
|
||||||
- icon={
|
|
||||||
- isActive ? (
|
|
||||||
- <BookmarkFilled style={[t.atoms.text]} width={iconWidth} />
|
|
||||||
- ) : (
|
|
||||||
- <Bookmark style={[t.atoms.text]} width={iconWidth} />
|
|
||||||
- )
|
|
||||||
- }
|
|
||||||
- label={_(msg({message: 'Saved', context: 'link to bookmarks screen'}))}
|
|
||||||
- onPress={onPress}
|
|
||||||
- />
|
|
||||||
- )
|
|
||||||
-}
|
|
||||||
-BookmarksMenuItem = React.memo(BookmarksMenuItem)
|
|
||||||
-
|
|
||||||
let ProfileMenuItem = ({
|
|
||||||
isActive,
|
|
||||||
onPress,
|
|
||||||
@@ -582,7 +340,7 @@ let ProfileMenuItem = ({
|
|
||||||
isActive: boolean
|
|
||||||
onPress: () => void
|
|
||||||
}): React.ReactNode => {
|
|
||||||
- const {_} = useLingui()
|
|
||||||
+ const { _ } = useLingui()
|
|
||||||
const t = useTheme()
|
|
||||||
return (
|
|
||||||
<MenuItem
|
|
||||||
@@ -600,8 +358,8 @@ let ProfileMenuItem = ({
|
|
||||||
}
|
|
||||||
ProfileMenuItem = React.memo(ProfileMenuItem)
|
|
||||||
|
|
||||||
-let SettingsMenuItem = ({onPress}: {onPress: () => void}): React.ReactNode => {
|
|
||||||
- const {_} = useLingui()
|
|
||||||
+let SettingsMenuItem = ({ onPress }: { onPress: () => void }): React.ReactNode => {
|
|
||||||
+ const { _ } = useLingui()
|
|
||||||
const t = useTheme()
|
|
||||||
return (
|
|
||||||
<MenuItem
|
|
||||||
@@ -613,7 +371,7 @@ let SettingsMenuItem = ({onPress}: {onPress: () => void}): React.ReactNode => {
|
|
||||||
}
|
|
||||||
SettingsMenuItem = React.memo(SettingsMenuItem)
|
|
||||||
|
|
||||||
-function MenuItem({icon, label, count, bold, onPress}: MenuItemProps) {
|
|
||||||
+function MenuItem({ icon, label, count, bold, onPress }: MenuItemProps) {
|
|
||||||
const t = useTheme()
|
|
||||||
return (
|
|
||||||
<Button
|
|
||||||
@@ -621,7 +379,7 @@ function MenuItem({icon, label, count, bold, onPress}: MenuItemProps) {
|
|
||||||
onPress={onPress}
|
|
||||||
accessibilityRole="tab"
|
|
||||||
label={label}>
|
|
||||||
- {({hovered, pressed}) => (
|
|
||||||
+ {({ hovered, pressed }) => (
|
|
||||||
<View
|
|
||||||
style={[
|
|
||||||
a.flex_1,
|
|
||||||
@@ -640,7 +398,7 @@ function MenuItem({icon, label, count, bold, onPress}: MenuItemProps) {
|
|
||||||
a.absolute,
|
|
||||||
a.inset_0,
|
|
||||||
a.align_end,
|
|
||||||
- {top: -4, right: a.gap_sm.gap * -1},
|
|
||||||
+ { top: -4, right: a.gap_sm.gap * -1 },
|
|
||||||
]}>
|
|
||||||
<View
|
|
||||||
style={[
|
|
||||||
@@ -686,37 +444,26 @@ function MenuItem({icon, label, count, bold, onPress}: MenuItemProps) {
|
|
||||||
}
|
|
||||||
|
|
||||||
function ExtraLinks() {
|
|
||||||
- const {_} = useLingui()
|
|
||||||
const t = useTheme()
|
|
||||||
- const kawaii = useKawaiiMode()
|
|
||||||
+ const navigation = useNavigation<NavigationProp>()
|
|
||||||
|
|
||||||
return (
|
|
||||||
<View style={[a.flex_col, a.gap_md, a.flex_wrap]}>
|
|
||||||
- <InlineLinkText
|
|
||||||
- style={[a.text_md]}
|
|
||||||
- label={_(msg`Terms of Service`)}
|
|
||||||
- to="https://bsky.social/about/support/tos">
|
- to="https://bsky.social/about/support/tos">
|
||||||
- <Trans>Terms of Service</Trans>
|
+ to="https://syu.is/about/support/tos">
|
||||||
- </InlineLinkText>
|
<Trans>Terms of Service</Trans>
|
||||||
- <InlineLinkText
|
</InlineLinkText>
|
||||||
- style={[a.text_md]}
|
<InlineLinkText
|
||||||
|
style={[a.text_md]}
|
||||||
- to="https://bsky.social/about/support/privacy-policy"
|
- to="https://bsky.social/about/support/privacy-policy"
|
||||||
- label={_(msg`Privacy Policy`)}>
|
+ to="https://syu.is/about/support/privacy-policy"
|
||||||
- <Trans>Privacy Policy</Trans>
|
label={_(msg`Privacy Policy`)}>
|
||||||
- </InlineLinkText>
|
<Trans>Privacy Policy</Trans>
|
||||||
- {kawaii && (
|
</InlineLinkText>
|
||||||
- <Text style={t.atoms.text_contrast_medium}>
|
|
||||||
- <Trans>
|
|
||||||
- Logo by{' '}
|
|
||||||
- <InlineLinkText
|
|
||||||
- style={[a.text_md]}
|
|
||||||
- to="/profile/sawaratsuki.bsky.social"
|
|
||||||
- label="@sawaratsuki.bsky.social">
|
|
||||||
- @sawaratsuki.bsky.social
|
|
||||||
- </InlineLinkText>
|
|
||||||
- </Trans>
|
|
||||||
+ <TouchableOpacity onPress={() => Linking.openURL('https://syu.is/about/support/tos')}>
|
|
||||||
+ <Text style={[a.text_md, t.atoms.text_contrast_medium]}>
|
|
||||||
+ Terms of Service
|
|
||||||
</Text>
|
|
||||||
- )}
|
|
||||||
+ </TouchableOpacity>
|
|
||||||
+ <TouchableOpacity onPress={() => Linking.openURL('https://syu.is/about/support/privacy-policy')}>
|
|
||||||
+ <Text style={[a.text_md, t.atoms.text_contrast_medium]}>
|
|
||||||
+ Privacy Policy
|
|
||||||
+ </Text>
|
|
||||||
+ </TouchableOpacity>
|
|
||||||
+ <TouchableOpacity onPress={() => navigation.navigate('License')}>
|
|
||||||
+ <Text style={[a.text_md, t.atoms.text_contrast_medium]}>
|
|
||||||
+ License
|
|
||||||
+ </Text>
|
|
||||||
+ </TouchableOpacity>
|
|
||||||
</View>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
diff --git a/src/view/shell/bottom-bar/BottomBar.tsx b/src/view/shell/bottom-bar/BottomBar.tsx
|
|
||||||
index 779ebda68..bfd9b70fa 100644
|
|
||||||
--- a/src/view/shell/bottom-bar/BottomBar.tsx
|
|
||||||
+++ b/src/view/shell/bottom-bar/BottomBar.tsx
|
|
||||||
@@ -198,38 +198,6 @@ export function BottomBar({navigation}: BottomTabBarProps) {
|
|
||||||
accessibilityLabel={_(msg`Search`)}
|
|
||||||
accessibilityHint=""
|
|
||||||
/>
|
|
||||||
- <Btn
|
|
||||||
- testID="bottomBarMessagesBtn"
|
|
||||||
- icon={
|
|
||||||
- isAtMessages ? (
|
|
||||||
- <MessageFilled
|
|
||||||
- width={iconWidth - 1}
|
|
||||||
- style={[styles.ctrlIcon, pal.text, styles.feedsIcon]}
|
|
||||||
- />
|
|
||||||
- ) : (
|
|
||||||
- <Message
|
|
||||||
- width={iconWidth - 1}
|
|
||||||
- style={[styles.ctrlIcon, pal.text, styles.feedsIcon]}
|
|
||||||
- />
|
|
||||||
- )
|
|
||||||
- }
|
|
||||||
- onPress={onPressMessages}
|
|
||||||
- notificationCount={numUnreadMessages.numUnread}
|
|
||||||
- hasNew={numUnreadMessages.hasNew}
|
|
||||||
- accessible={true}
|
|
||||||
- accessibilityRole="tab"
|
|
||||||
- accessibilityLabel={_(msg`Chat`)}
|
|
||||||
- accessibilityHint={
|
|
||||||
- numUnreadMessages.count > 0
|
|
||||||
- ? _(
|
|
||||||
- msg`${plural(numUnreadMessages.numUnread ?? 0, {
|
|
||||||
- one: '# unread item',
|
|
||||||
- other: '# unread items',
|
|
||||||
- })}` || '',
|
|
||||||
- )
|
|
||||||
- : ''
|
|
||||||
- }
|
|
||||||
- />
|
|
||||||
<Btn
|
|
||||||
testID="bottomBarNotificationsBtn"
|
|
||||||
icon={
|
|
||||||
diff --git a/src/view/shell/desktop/RightNav.tsx b/src/view/shell/desktop/RightNav.tsx
|
diff --git a/src/view/shell/desktop/RightNav.tsx b/src/view/shell/desktop/RightNav.tsx
|
||||||
index 1d097fc9a..1ad7026a2 100644
|
index 1d097fc9a..1ad7026a2 100644
|
||||||
--- a/src/view/shell/desktop/RightNav.tsx
|
--- a/src/view/shell/desktop/RightNav.tsx
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
diff --git a/src/components/dialogs/ServerInput.tsx b/src/components/dialogs/ServerInput.tsx
|
|
||||||
--- a/src/components/dialogs/ServerInput.tsx
|
|
||||||
+++ b/src/components/dialogs/ServerInput.tsx
|
|
||||||
@@ -144,9 +144,9 @@
|
|
||||||
<SegmentedControl.Item
|
|
||||||
testID="bskyServiceSelectBtn"
|
|
||||||
value={BSKY_SERVICE}
|
|
||||||
- label={_(msg`Bluesky`)}>
|
|
||||||
+ label={_(msg`syu.is`)}>
|
|
||||||
<SegmentedControl.ItemText>
|
|
||||||
- {_(msg`Bluesky`)}
|
|
||||||
+ {_(msg`syu.is`)}
|
|
||||||
</SegmentedControl.ItemText>
|
|
||||||
</SegmentedControl.Item>
|
|
||||||
<SegmentedControl.Item
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
diff --git a/src/lib/api/feed/custom.ts b/src/lib/api/feed/custom.ts
|
diff --git a/src/lib/api/feed/custom.ts b/src/lib/api/feed/custom.ts
|
||||||
index 123456789..987654321 100644
|
index 18bb8c8f0..bab286d7a 100644
|
||||||
--- a/src/lib/api/feed/custom.ts
|
--- a/src/lib/api/feed/custom.ts
|
||||||
+++ b/src/lib/api/feed/custom.ts
|
+++ b/src/lib/api/feed/custom.ts
|
||||||
@@ -6,6 +6,7 @@ import {
|
@@ -5,6 +5,7 @@ import {
|
||||||
jsonStringToLex,
|
jsonStringToLex,
|
||||||
} from '@atproto/api'
|
} from '@atproto/api'
|
||||||
|
|
||||||
@@ -10,7 +10,48 @@ index 123456789..987654321 100644
|
|||||||
import {
|
import {
|
||||||
getAppLanguageAsContentLanguage,
|
getAppLanguageAsContentLanguage,
|
||||||
getContentLanguages,
|
getContentLanguages,
|
||||||
@@ -119,7 +120,7 @@ async function loggedOutFetch({
|
@@ -12,6 +13,17 @@ import {
|
||||||
|
import {type FeedAPI, type FeedAPIResponse} from './types'
|
||||||
|
import {createBskyTopicsHeader, isBlueskyOwnedFeed} from './utils'
|
||||||
|
|
||||||
|
+// Check if the feed is hosted on syu.is network
|
||||||
|
+function isSyuIsFeed(feedUri: string): boolean {
|
||||||
|
+ return feedUri.includes('did:plc:6qyecktefllvenje24fcxnie') || feedUri.includes('syu.is')
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+// Check if the agent is connected to syu.is
|
||||||
|
+function isAgentOnSyuIs(agent: BskyAgent): boolean {
|
||||||
|
+ const serviceUrl = agent.service?.toString() || ''
|
||||||
|
+ return serviceUrl.includes('syu.is')
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
export class CustomFeedAPI implements FeedAPI {
|
||||||
|
agent: BskyAgent
|
||||||
|
params: GetCustomFeed.QueryParams
|
||||||
|
@@ -54,8 +66,12 @@ export class CustomFeedAPI implements FeedAPI {
|
||||||
|
const agent = this.agent
|
||||||
|
const isBlueskyOwned = isBlueskyOwnedFeed(this.params.feed)
|
||||||
|
|
||||||
|
- const res = agent.did
|
||||||
|
- ? await this.agent.app.bsky.feed.getFeed(
|
||||||
|
+ // For syu.is feeds accessed from non-syu.is accounts, use PUBLIC_APPVIEW
|
||||||
|
+ const needsPublicAppView = isSyuIsFeed(this.params.feed) && !isAgentOnSyuIs(agent)
|
||||||
|
+
|
||||||
|
+ const res = !agent.did || needsPublicAppView
|
||||||
|
+ ? await loggedOutFetch({...this.params, cursor, limit})
|
||||||
|
+ : await this.agent.app.bsky.feed.getFeed(
|
||||||
|
{
|
||||||
|
...this.params,
|
||||||
|
cursor,
|
||||||
|
@@ -70,7 +86,6 @@ export class CustomFeedAPI implements FeedAPI {
|
||||||
|
},
|
||||||
|
},
|
||||||
|
)
|
||||||
|
- : await loggedOutFetch({...this.params, cursor, limit})
|
||||||
|
if (res.success) {
|
||||||
|
// NOTE
|
||||||
|
// some custom feeds fail to enforce the pagination limit
|
||||||
|
@@ -120,7 +135,7 @@ async function loggedOutFetch({
|
||||||
|
|
||||||
// manually construct fetch call so we can add the `lang` cache-busting param
|
// manually construct fetch call so we can add the `lang` cache-busting param
|
||||||
let res = await fetch(
|
let res = await fetch(
|
||||||
@@ -19,7 +60,7 @@ index 123456789..987654321 100644
|
|||||||
cursor ? `&cursor=${cursor}` : ''
|
cursor ? `&cursor=${cursor}` : ''
|
||||||
}&limit=${limit}&lang=${contentLangs}`,
|
}&limit=${limit}&lang=${contentLangs}`,
|
||||||
{
|
{
|
||||||
@@ -139,7 +140,7 @@ async function loggedOutFetch({
|
@@ -140,7 +155,7 @@ async function loggedOutFetch({
|
||||||
|
|
||||||
// no data, try again with language headers removed
|
// no data, try again with language headers removed
|
||||||
res = await fetch(
|
res = await fetch(
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ PATCH_FILES_IOS=(
|
|||||||
"023-social-app-ios-disable-dm.patch"
|
"023-social-app-ios-disable-dm.patch"
|
||||||
"024-social-app-ios-disable-external-services.patch"
|
"024-social-app-ios-disable-external-services.patch"
|
||||||
"025-social-app-ios-bskyweb-title.patch"
|
"025-social-app-ios-bskyweb-title.patch"
|
||||||
"026-social-app-ios-serverinput-label.patch"
|
|
||||||
"027-social-app-ios-remove-birthdate.patch"
|
"027-social-app-ios-remove-birthdate.patch"
|
||||||
"028-social-app-ios-remove-discover-feeds.patch"
|
"028-social-app-ios-remove-discover-feeds.patch"
|
||||||
"029-social-app-ios-remove-feeds-discover.patch"
|
"029-social-app-ios-remove-feeds-discover.patch"
|
||||||
|
|||||||
Reference in New Issue
Block a user