Skip to content

Commit

Permalink
Rip out more prefs
Browse files Browse the repository at this point in the history
  • Loading branch information
estrattonbailey committed Nov 13, 2023
1 parent 2d891a6 commit 8e66dea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 31 deletions.
27 changes: 0 additions & 27 deletions src/state/models/ui/preferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/view/com/posts/FeedErrorMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -86,12 +86,12 @@ function FeedgenErrorMessage({
knownError: KnownError
}) {
const pal = usePalette('default')
const store = useStores()
const navigation = useNavigation<NavigationProp>()
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})
Expand All @@ -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.',
Expand All @@ -116,7 +116,7 @@ function FeedgenErrorMessage({
closeModal()
},
})
}, [store, openModal, closeModal, uri])
}, [openModal, closeModal, uri, removeFeed])

return (
<View
Expand Down

0 comments on commit 8e66dea

Please sign in to comment.