From fd303723aa17ce5b77d14a05c280ac145698cc27 Mon Sep 17 00:00:00 2001 From: Andrey Platov Date: Thu, 2 Sep 2021 11:26:45 +0200 Subject: [PATCH] remove unassigned social links Signed-off-by: Andrey Platov --- .../src/components/ChannelsPresenter.svelte | 4 ++-- plugins/recruit-resources/src/components/SocialEditor.svelte | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/contact-resources/src/components/ChannelsPresenter.svelte b/plugins/contact-resources/src/components/ChannelsPresenter.svelte index d93c906ca1..b6aa036931 100644 --- a/plugins/contact-resources/src/components/ChannelsPresenter.svelte +++ b/plugins/contact-resources/src/components/ChannelsPresenter.svelte @@ -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[] = [] diff --git a/plugins/recruit-resources/src/components/SocialEditor.svelte b/plugins/recruit-resources/src/components/SocialEditor.svelte index 6eadbedf85..a16cd5abbc 100644 --- a/plugins/recruit-resources/src/components/SocialEditor.svelte +++ b/plugins/recruit-resources/src/components/SocialEditor.svelte @@ -49,6 +49,9 @@ } }) + function filterUndefined(channels: Channel[]): Channel[] { + return channels.filter(channel => channel.value !== undefined && channel.value.length > 0) + } @@ -64,7 +67,7 @@ --> -