Skip to content

Commit

Permalink
Merge pull request #10456 from Jarsen136/issue-10446
Browse files Browse the repository at this point in the history
fix: Create profile when not connected
  • Loading branch information
vikiival authored Jun 12, 2024
2 parents b277b03 + 1a6fbbf commit a84b770
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions components/profile/ProfileDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ const createProfileConfig: ButtonConfig = {
variant: 'k-accent',
}
const followConfig: ButtonConfig = {
const followConfig = computed<ButtonConfig>(() => ({
label: $i18n.t('profile.follow'),
icon: 'plus',
disabled: !accountId.value,
Expand All @@ -487,13 +487,13 @@ const followConfig: ButtonConfig = {
showFollowing.value = isFollowingThisAccount.value || false
},
classes: 'hover:!bg-transparent',
}
}))
const followingConfig: ButtonConfig = {
label: $i18n.t('profile.following'),
}
const unfollowConfig: ButtonConfig = {
const unfollowConfig = computed<ButtonConfig>(() => ({
label: $i18n.t('profile.unfollow'),
onClick: () => {
unfollow({
Expand All @@ -502,7 +502,7 @@ const unfollowConfig: ButtonConfig = {
}).then(refresh)
},
classes: 'hover:!border-k-red',
}
}))
const buttonRef = ref(null)
const showFollowing = ref(false)
Expand Down Expand Up @@ -556,7 +556,9 @@ const buttonConfig = computed((): ButtonConfig => {
) {
return { ...followingConfig, active: isHovered.value }
}
return isFollowingThisAccount.value ? unfollowConfig : followConfig
return isFollowingThisAccount.value
? unfollowConfig.value
: followConfig.value
})
const switchToTab = (tab: ProfileTab) => {
Expand Down

0 comments on commit a84b770

Please sign in to comment.