fix: reset feed search, close #701

This commit is contained in:
Stephen Zhou 2024-09-29 10:23:01 +08:00
parent a60ea08fca
commit a060986fa3
No known key found for this signature in database
2 changed files with 9 additions and 2 deletions

View File

@ -345,7 +345,11 @@ export const ListFeedsModalContent = ({ id }: { id: string }) => {
const { t } = useTranslation("settings")
const [feedSearchFor, setFeedSearchFor] = useState("")
const addMutation = useAddFeedToFeedList()
const addMutation = useAddFeedToFeedList({
onSuccess: () => {
setFeedSearchFor("")
},
})
const allFeeds = useSubscriptionStore((store) => {
const feedInfo = [] as { title: string; id: string }[]

View File

@ -62,7 +62,10 @@ export const useFeedHeaderTitle = () => {
}
}
export const useAddFeedToFeedList = (options?: { onSuccess: () => void; onError: () => void }) => {
export const useAddFeedToFeedList = (options?: {
onSuccess?: () => void
onError?: () => void
}) => {
const { t } = useTranslation("settings")
return useMutation({
mutationFn: async (