Skip to content

Commit

Permalink
fix: bugfix for sync lens follow status (#11309)
Browse files Browse the repository at this point in the history
  • Loading branch information
nuanyang233 authored and guanbinrui committed Jan 30, 2024
1 parent d9acb9b commit 4bc76c1
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -151,7 +151,7 @@ export function FollowLensDialog({ handle, onClose }: Props) {

const { profile, defaultProfile, isSelf, profiles } = value ?? {}

const { isPending } = useQuery({
const { isPending, isFetching } = useQuery({
queryKey: ['lens', 'following-status', currentProfile?.id, value?.profile.id],
queryFn: async () => {
if (!value?.profile.id || !currentProfile) return false
Expand All @@ -160,6 +160,7 @@ export function FollowLensDialog({ handle, onClose }: Props) {
return result
},
refetchOnWindowFocus: false,
staleTime: 0,
})

const followModule = useMemo(() => {
Expand Down Expand Up @@ -401,7 +402,13 @@ export function FollowLensDialog({ handle, onClose }: Props) {
variant="roundedContained"
className={classes.followAction}
disabled={disabled}
loading={followLoading || unfollowLoading || loading || isPending}
loading={
followLoading ||
unfollowLoading ||
loading ||
isPending ||
isFetching
}
onClick={handleClick}
onMouseOver={() => setIsHovering(true)}
onMouseOut={() => setIsHovering(false)}>
Expand Down

0 comments on commit 4bc76c1

Please sign in to comment.