mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 19:58:09 +00:00
Userbox: clean up selected for user box on value change (#2199)
Signed-off-by: Anna <anna.no@xored.com>
This commit is contained in:
parent
da844e4616
commit
f30961e665
@ -62,11 +62,11 @@
|
||||
|
||||
const client = getClient()
|
||||
|
||||
async function updateSelected (value: Ref<Contact>) {
|
||||
selected = await client.findOne(_class, { _id: value })
|
||||
async function updateSelected (value: Ref<Contact> | null | undefined) {
|
||||
selected = value ? await client.findOne(_class, { _id: value }) : undefined
|
||||
}
|
||||
|
||||
$: if (value != null) updateSelected(value)
|
||||
$: updateSelected(value)
|
||||
|
||||
function getName (obj: Contact): string {
|
||||
const isPerson = client.getHierarchy().isDerived(obj._class, contact.class.Person)
|
||||
|
Loading…
Reference in New Issue
Block a user