fix: display user full name from single name field
Align account display with the merged name schema that no longer uses surname.
This commit is contained in:
@@ -35,8 +35,7 @@ const router = useRouter()
|
||||
|
||||
const initials = computed(() => {
|
||||
const name = auth.user?.name || ''
|
||||
const surname = auth.user?.surname || ''
|
||||
return `${name.charAt(0)}${surname.charAt(0)}` || 'گ'
|
||||
return name.charAt(0) || 'گ'
|
||||
})
|
||||
|
||||
async function handleLogout() {
|
||||
|
||||
@@ -11,7 +11,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
const isAuthenticated = computed(() => !!accessToken.value)
|
||||
const fullName = computed(() => {
|
||||
if (!user.value) return ''
|
||||
return `${user.value.name || ''} ${user.value.surname || ''}`.trim()
|
||||
return `${user.value.name || ''}`.trim()
|
||||
})
|
||||
|
||||
function setTokens(access, refresh) {
|
||||
|
||||
Reference in New Issue
Block a user