remove unassigned social links

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov 2021-09-02 11:26:45 +02:00
parent 667e577575
commit fd303723aa
No known key found for this signature in database
GPG Key ID: C8787EFEB4B64AF0
2 changed files with 6 additions and 3 deletions

View File

@ -24,7 +24,7 @@ import { Icon } from '@anticrm/ui'
import contact from '@anticrm/contact'
export let value: Channel[]
export let value: Channel[] | undefined
interface Item {
label: IntlString,
@ -59,7 +59,7 @@ async function update(value: Channel[]) {
displayItems = result
}
$: update(value)
$: if (value !== undefined) update(value)
let displayItems: Item[] = []

View File

@ -49,6 +49,9 @@
}
})
function filterUndefined(channels: Channel[]): Channel[] {
return channels.filter(channel => channel.value !== undefined && channel.value.length > 0)
}
</script>
@ -64,7 +67,7 @@
<EditBox label={'Twitter'} placeholder={'@rosychen'} maxWidth={'12.5rem'} />
<EditBox label={'Facebook'} placeholder={'facebook/rosamundch'} maxWidth={'12.5rem'} />
</div> -->
<Button label="Apply" on:click={() => { dispatch('close', newValues) }}/>
<Button label="Apply" on:click={() => { dispatch('close', filterUndefined(newValues)) }}/>
</div>
<style lang="scss">