diff --git a/src/state/models/ui/preferences.ts b/src/state/models/ui/preferences.ts index 1068ac6516..a4c3517cc2 100644 --- a/src/state/models/ui/preferences.ts +++ b/src/state/models/ui/preferences.ts @@ -126,33 +126,6 @@ export class PreferencesModel { ], } } - - // feeds - // = - - isPinnedFeed(uri: string) { - return this.pinnedFeeds.includes(uri) - } - - /** - * @deprecated use `useAddSavedFeedMutation` from `#/state/queries/preferences` instead - */ - async addSavedFeed(_v: string) {} - - /** - * @deprecated use `useRemoveSavedFeedMutation` from `#/state/queries/preferences` instead - */ - async removeSavedFeed(_v: string) {} - - /** - * @deprecated use `usePinFeedMutation` from `#/state/queries/preferences` instead - */ - async addPinnedFeed(_v: string) {} - - /** - * @deprecated use `useUnpinFeedMutation` from `#/state/queries/preferences` instead - */ - async removePinnedFeed(_v: string) {} } // TEMP we need to permanently convert 'show' to 'ignore', for now we manually convert -prf diff --git a/src/view/com/posts/FeedErrorMessage.tsx b/src/view/com/posts/FeedErrorMessage.tsx index e29b35f8a9..0ace06e9a4 100644 --- a/src/view/com/posts/FeedErrorMessage.tsx +++ b/src/view/com/posts/FeedErrorMessage.tsx @@ -8,12 +8,12 @@ import {ErrorMessage} from '../util/error/ErrorMessage' import {usePalette} from 'lib/hooks/usePalette' import {useNavigation} from '@react-navigation/native' import {NavigationProp} from 'lib/routes/types' -import {useStores} from 'state/index' import {logger} from '#/logger' import {useModalControls} from '#/state/modals' import {FeedDescriptor} from '#/state/queries/post-feed' import {EmptyState} from '../util/EmptyState' import {cleanError} from '#/lib/strings/errors' +import {useRemoveFeedMutation} from '#/state/queries/preferences' enum KnownError { Block, @@ -86,12 +86,12 @@ function FeedgenErrorMessage({ knownError: KnownError }) { const pal = usePalette('default') - const store = useStores() const navigation = useNavigation() const msg = MESSAGES[knownError] const [_, uri] = feedDesc.split('|') const [ownerDid] = safeParseFeedgenUri(uri) const {openModal, closeModal} = useModalControls() + const {mutateAsync: removeFeed} = useRemoveFeedMutation() const onViewProfile = React.useCallback(() => { navigation.navigate('Profile', {name: ownerDid}) @@ -104,7 +104,7 @@ function FeedgenErrorMessage({ message: 'Remove this feed from your saved feeds?', async onPressConfirm() { try { - await store.preferences.removeSavedFeed(uri) + await removeFeed({uri}) } catch (err) { Toast.show( 'There was an an issue removing this feed. Please check your internet connection and try again.', @@ -116,7 +116,7 @@ function FeedgenErrorMessage({ closeModal() }, }) - }, [store, openModal, closeModal, uri]) + }, [openModal, closeModal, uri, removeFeed]) return (