Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

followers modal when disconnected #10260

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion components/profile/follow/Modal.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<NeoModal :value="vOpen" @close="close">
<NeoModal :key="accountId" :value="vOpen" @close="close">
<ModalBody content-class="px-6 py-5" @close="close">
<template #header>
<div class="flex">
Expand Down Expand Up @@ -39,6 +39,8 @@ import TabItem from '@/components/shared/TabItem.vue'
import { Follower } from '@/services/profile'
import { Tab } from '@/components/profile/types'

const { accountId } = useAuth()

const emit = defineEmits(['close'])

const props = defineProps<{
Expand Down
14 changes: 10 additions & 4 deletions components/profile/follow/UserRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import {
} from '@/services/profile'
import { ButtonConfig } from '@/components/profile/types'

const { accountId } = useAuth()
const { accountId, isLogIn } = useAuth()
const { $i18n } = useNuxtApp()

const props = defineProps<{
Expand All @@ -66,8 +66,12 @@ const { data: followersCount, refresh: refreshCount } = useAsyncData(
)

const { data: isFollowed, refresh: refreshFollowStatus } = useAsyncData(
`${accountId.value}/isFollowing/${props.user.address}`,
() => isFollowing(accountId.value, props.user.address),
`${isLogIn.value ? accountId.value : ''}/isFollowing/${props.user.address}`,
() =>
isLogIn.value
? isFollowing(accountId.value, props.user.address)
: Promise.resolve(false),
{},
)

const refresh = () => {
Expand All @@ -86,7 +90,9 @@ const followConfig: ButtonConfig = {
showFollowing.value = true
refresh()
},
disabled: props.user.address === toSubstrateAddress(accountId.value),
disabled:
!isLogIn.value ||
props.user.address === toSubstrateAddress(accountId.value),
classes: 'hover:!bg-transparent',
}

Expand Down
1 change: 0 additions & 1 deletion composables/useProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default function useUserProfile() {
}
try {
const response = await fetchProfileByAddress(account)
console.log('Profile fetch response:', response)

userProfileData.value = response
hasProfile.value = true
Expand Down