mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-21 07:46:24 +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()
|
const client = getClient()
|
||||||
|
|
||||||
async function updateSelected (value: Ref<Contact>) {
|
async function updateSelected (value: Ref<Contact> | null | undefined) {
|
||||||
selected = await client.findOne(_class, { _id: value })
|
selected = value ? await client.findOne(_class, { _id: value }) : undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
$: if (value != null) updateSelected(value)
|
$: updateSelected(value)
|
||||||
|
|
||||||
function getName (obj: Contact): string {
|
function getName (obj: Contact): string {
|
||||||
const isPerson = client.getHierarchy().isDerived(obj._class, contact.class.Person)
|
const isPerson = client.getHierarchy().isDerived(obj._class, contact.class.Person)
|
||||||
|
Loading…
Reference in New Issue
Block a user