handle deleted lists

This commit is contained in:
Samuel Newman
2025-06-27 14:08:27 +03:00
parent f52f828a82
commit 399a9c25e0
+47 -17
View File
@@ -14,6 +14,7 @@ import {isNative, isWeb} from '#/platform/detection'
import {useModerationOpts} from '#/state/preferences/moderation-opts' import {useModerationOpts} from '#/state/preferences/moderation-opts'
import { import {
type FeedSourceInfo, type FeedSourceInfo,
getFeedTypeFromUri,
hydrateFeedGenerator, hydrateFeedGenerator,
hydrateList, hydrateList,
useFeedSourceInfoQuery, useFeedSourceInfoQuery,
@@ -25,7 +26,7 @@ import {atoms as a, useTheme, web} from '#/alf'
import {Button, ButtonText} from '#/components/Button' import {Button, ButtonText} from '#/components/Button'
import * as Dialog from '#/components/Dialog' import * as Dialog from '#/components/Dialog'
import {Divider} from '#/components/Divider' import {Divider} from '#/components/Divider'
import {Warning_Stroke2_Corner0_Rounded} from '#/components/icons/Warning' import {Warning_Stroke2_Corner0_Rounded as WarningIcon} from '#/components/icons/Warning'
import {Link} from '#/components/Link' import {Link} from '#/components/Link'
import * as ProfileCard from '#/components/ProfileCard' import * as ProfileCard from '#/components/ProfileCard'
import {RichText} from '#/components/RichText' import {RichText} from '#/components/RichText'
@@ -247,10 +248,16 @@ function MissingFeed({
const moderationOpts = useModerationOpts() const moderationOpts = useModerationOpts()
const control = Dialog.useDialogControl() const control = Dialog.useDialogControl()
const type = getFeedTypeFromUri(uri)
return ( return (
<> <>
<Button <Button
label={_(msg`Could not connect to custom feed`)} label={
type === 'feed'
? _(msg`Could not connect to custom feed`)
: _(msg`Deleted list`)
}
accessibilityHint={_(msg`Tap for more information`)} accessibilityHint={_(msg`Tap for more information`)}
onPress={control.open} onPress={control.open}
style={[ style={[
@@ -272,14 +279,18 @@ function MissingFeed({
a.align_center, a.align_center,
a.justify_center, a.justify_center,
]}> ]}>
<Warning_Stroke2_Corner0_Rounded size="lg" /> <WarningIcon size="lg" />
</View> </View>
<View style={[a.flex_1]}> <View style={[a.flex_1]}>
<Text <Text
emoji emoji
style={[a.text_sm, a.font_bold, a.leading_snug, a.italic]} style={[a.text_sm, a.font_bold, a.leading_snug, a.italic]}
numberOfLines={1}> numberOfLines={1}>
<Trans>Feed unavailable</Trans> {type === 'feed' ? (
<Trans>Feed unavailable</Trans>
) : (
<Trans>Deleted list</Trans>
)}
</Text> </Text>
<Text <Text
style={[ style={[
@@ -307,18 +318,32 @@ function MissingFeed({
style={web({maxWidth: 500})}> style={web({maxWidth: 500})}>
<View style={[a.gap_sm]}> <View style={[a.gap_sm]}>
<Text style={[a.font_heavy, a.text_2xl]}> <Text style={[a.font_heavy, a.text_2xl]}>
<Trans>Could not connect to feed service</Trans> {type === 'feed' ? (
<Trans>Could not connect to feed service</Trans>
) : (
<Trans>Deleted list</Trans>
)}
</Text> </Text>
<Text style={[t.atoms.text_contrast_high, a.leading_snug]}> <Text style={[t.atoms.text_contrast_high, a.leading_snug]}>
<Trans> {type === 'feed' ? (
We could not connect to the service that provides this custom <Trans>
feed. It may be temporarily unavailable and experiencing issues, We could not connect to the service that provides this custom
or permanently unavailable. feed. It may be temporarily unavailable and experiencing
</Trans> issues, or permanently unavailable.
</Trans>
) : (
<Trans>
We could not find this list. It was probably deleted.
</Trans>
)}
</Text> </Text>
<Divider style={[a.my_md]} /> <Divider style={[a.my_md]} />
<Text style={[a.font_bold, t.atoms.text_contrast_high]}> <Text style={[a.font_bold, t.atoms.text_contrast_high]}>
<Trans>Feed creator</Trans> {type === 'feed' ? (
<Trans>Feed creator</Trans>
) : (
<Trans>List creator</Trans>
)}
</Text> </Text>
{profile && moderationOpts && ( {profile && moderationOpts && (
<View style={[a.w_full, a.align_start]}> <View style={[a.w_full, a.align_start]}>
@@ -350,12 +375,17 @@ function MissingFeed({
<Trans>Could not find profile</Trans> <Trans>Could not find profile</Trans>
</Text> </Text>
)} )}
<Text style={[a.font_bold, t.atoms.text_contrast_high, a.mt_md]}> {type === 'feed' && (
<Trans>Feed identifier</Trans> <>
</Text> <Text
<Text style={[a.text_md, t.atoms.text_contrast_high, a.italic]}> style={[a.font_bold, t.atoms.text_contrast_high, a.mt_md]}>
{atUri.rkey} <Trans>Feed identifier</Trans>
</Text> </Text>
<Text style={[a.text_md, t.atoms.text_contrast_high, a.italic]}>
{atUri.rkey}
</Text>
</>
)}
{error instanceof Error && ( {error instanceof Error && (
<> <>
<Text <Text