Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: prevent thumbnail screenshot if not live #1266

Merged
merged 4 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading