diff --git a/src/lib/components/Channel/Chat/DrawerEditChannel.svelte b/src/lib/components/Channel/Chat/DrawerEditChannel.svelte index fb9004be..bc10de3b 100644 --- a/src/lib/components/Channel/Chat/DrawerEditChannel.svelte +++ b/src/lib/components/Channel/Chat/DrawerEditChannel.svelte @@ -10,7 +10,7 @@ import IconChatScreenshot from '$lib/assets/icons/chat/IconChatScreenshot.svelte' import { captureScreenShot } from '$lib/utils' - export let channel: any, showDrawer: boolean + export let channel: any, showDrawer: boolean, isLive: boolean let fileuploader: HTMLInputElement, thumbnailRef: any, @@ -18,14 +18,14 @@ showAddCategory = false, maxTag = 3, maxCategory = 4, - imageSrc: string = '' + imageSrc: string = '', + inputTags: HTMLInputElement $: maxTagLabel = channel?.tags.length == maxTag ? 'max reached' : 'max ' + maxTag $: maxCategoryLabel = channel?.category.length == maxCategory ? 'max reached' : 'max ' + maxCategory onMount(async () => { - let inputTags = document.getElementById('tags') inputTags?.setAttribute('maxlength', '20') if (!$tags.length) { const suggestedTags = await get(`tags`) @@ -56,7 +56,7 @@ const checkVideo = (e: any) => { e.preventDefault() showThumbnail = true - if (channel.videoItems.length > 0) { + if (isLive && channel.videoItems.length > 0) { imageSrc = captureScreenShot(channel) } } @@ -181,7 +181,7 @@ 0 ? '' : 'Tag'} /> ({maxTagLabel}) {#if channel.tags.length === 0} @@ -217,7 +217,7 @@
- +
diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 5eb3faa3..a2a9b629 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -387,7 +387,7 @@ export const getHref = async ({ 'x-api-key': xApiKey } }) - const { loginUrl } = await response.json() + const { loginUrl }: any = await response.json() window.location.replace(loginUrl) } diff --git a/src/routes/channel/[channelId]/+page.svelte b/src/routes/channel/[channelId]/+page.svelte index fb7502b5..1916b656 100644 --- a/src/routes/channel/[channelId]/+page.svelte +++ b/src/routes/channel/[channelId]/+page.svelte @@ -407,7 +407,7 @@ bind:viewers /> {#if showEditChannelDrawer} - + {/if} {#if !$is_chat_drawer_destroy}