Skip to content

Commit

Permalink
Merge pull request #1266 from CodeCrowCorp/dev
Browse files Browse the repository at this point in the history
Fix: prevent thumbnail screenshot if not live
  • Loading branch information
gagansuie authored May 23, 2024
2 parents 2281c3b + d81b398 commit 3cd3703
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/lib/components/Channel/Chat/DrawerEditChannel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
}
}
Expand Down Expand Up @@ -217,7 +217,7 @@
<div class="flex flex-row gap-2 mt-auto p-3">
<button type="button" class="btn btn-neutral grow" on:click={() => toggleDrawer()}
>Cancel</button>
<button type="submit" class="btn btn-primary grow">Edit</button>
<button type="submit" class="btn btn-primary grow">Apply</button>
</div>
</div>
</form>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion src/routes/channel/[channelId]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@
bind:viewers />

{#if showEditChannelDrawer}
<DrawerEditChannel bind:channel bind:showDrawer={showEditChannelDrawer} />
<DrawerEditChannel bind:channel bind:showDrawer={showEditChannelDrawer} bind:isLive />
{/if}
</div>
{#if !$is_chat_drawer_destroy}
Expand Down

0 comments on commit 3cd3703

Please sign in to comment.