uberf-9603: fix account rename (#8371)
Some checks are pending
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / uitest-workspaces (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions

Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
Alexey Zinoviev 2025-03-28 00:33:22 +04:00 committed by GitHub
parent c6326b3c73
commit 9b7a85ec4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 13 deletions

View File

@ -334,14 +334,6 @@ export const myEmployeeStore = derived(
export const personByIdStore = writable<IdMap<WithLookup<Person>>>(new Map())
export const socialIdsStore = writable<Array<WithLookup<SocialIdentity>>>([])
// NOTE
// In-workspace social ids of the current employee
// Should not be used except some rare cases
// Use getCurrentAccount().socialIds instead
export const mySocialIdsStore = derived([currentEmployeeRefStore, socialIdsStore], ([myEmployeeRef, socialIds]) => {
return socialIds.filter((si) => si.attachedTo === myEmployeeRef)
})
/**
* [Ref<Person> => SocialIdentity[]] mapping
*/

View File

@ -14,7 +14,7 @@
-->
<script lang="ts">
import contact, { combineName, getCurrentEmployee, getFirstName, getLastName } from '@hcengineering/contact'
import { ChannelsEditor, EditableAvatar, personByIdStore, mySocialIdsStore } from '@hcengineering/contact-resources'
import { ChannelsEditor, EditableAvatar, personByIdStore } from '@hcengineering/contact-resources'
import { getCurrentAccount, SocialIdType } from '@hcengineering/core'
import login, { loginId } from '@hcengineering/login'
import { getResource } from '@hcengineering/platform'
@ -36,11 +36,11 @@
const client = getClient()
const account = getCurrentAccount()
const me = getCurrentEmployee()
const employee = $personByIdStore.get(me)
const email = account.fullSocialIds.find((si) => si.type === SocialIdType.EMAIL)?.value ?? ''
$: employee = $personByIdStore.get(me)
$: firstName = employee !== undefined ? getFirstName(employee.name) : ''
$: lastName = employee !== undefined ? getLastName(employee.name) : ''
$: email = $mySocialIdsStore.find((si) => si.type === SocialIdType.EMAIL)?.value ?? ''
let firstName = employee !== undefined ? getFirstName(employee.name) : ''
let lastName = employee !== undefined ? getLastName(employee.name) : ''
let avatarEditor: EditableAvatar
async function onAvatarDone (e: any): Promise<void> {