Skip to content

Commit

Permalink
Merge pull request #775 from gagansuie/dev
Browse files Browse the repository at this point in the history
Fix: enabling and disabling restream
  • Loading branch information
gagansuie authored Oct 30, 2023
2 parents bcf0dd6 + 7748bf0 commit f99d7df
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mage-website",
"version": "0.1.07",
"version": "0.1.08",
"license": "GPL-3.0",
"private": true,
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Channel/Chat/DrawerRestream.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
class="btn btn-neutral text-white grow w-full"
on:click={() => {
document.getElementById('overlay')?.click()
}}>Cancel</button>
}}>Close</button>
</div>
</ul>
</div>
Expand Down
27 changes: 17 additions & 10 deletions src/lib/components/Channel/Stream/StreamControls.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
is_feature_apps_enabled,
is_feature_restream_enabled
} from '$lib/stores/remoteConfigStore'
import {
is_restream_drawer_open
} from '$lib/stores/channelStore'
import { is_restream_drawer_open } from '$lib/stores/channelStore'
export let isHostOrGuest: boolean = false,
channel: any,
Expand Down Expand Up @@ -350,7 +348,6 @@
subs()
})
})
</script>

<div class="flex flex-col sm:flex-row gap-4">
Expand Down Expand Up @@ -417,12 +414,22 @@
!videoItemIsActive}>
<IconShareObs />
</button>
{#if $is_feature_restream_enabled}
<button on:click={() => {
$is_restream_drawer_open = !$is_restream_drawer_open
}} class="flex items-center btn text-white border-none tooltip font-normal normal-case {$is_restream_drawer_open
? 'btn-primary'
: 'btn-neutral'}" >
{#if $is_feature_restream_enabled}
<button
class="flex items-center btn text-white border-none tooltip font-normal normal-case {$is_restream_drawer_open
? 'btn-primary'
: 'btn-neutral'}"
data-tip="Restream"
on:click={() => {
$is_restream_drawer_open = !$is_restream_drawer_open
}}
disabled={$is_sharing_obs ||
$is_sharing_screen ||
$is_sharing_webcam ||
$is_sharing_audio ||
!isHostOrGuest ||
!isChannelSocketConnected ||
!videoItemIsActive}>
<IconRestream />
</button>
{/if}
Expand Down
2 changes: 0 additions & 2 deletions src/lib/stores/channelStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@ export const is_chat_drawer_destroy: Writable<boolean> = writable(false)
export const was_chat_drawer_closed: Writable<boolean> = writable(false)

export const is_restream_drawer_open: Writable<boolean> = writable(false)
export const is_restream_drawer_destroy: Writable<boolean> = writable(false)
export const was_restream_drawer_closed: Writable<boolean> = writable(false)
9 changes: 3 additions & 6 deletions src/routes/channel/[channelId]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import DrawerChat from '$lib/components/Channel/Chat/DrawerChat.svelte'
import StreamContainer from '$lib/components/Channel/Stream/StreamContainer.svelte'
import { onDestroy, onMount } from 'svelte'
import { get, del, post, put, patch } from '$lib/api'
import { get, del, post } from '$lib/api'
import {
emitChatHistoryToChannel,
initChannelSocket,
Expand All @@ -22,9 +22,7 @@
is_sharing_audio,
updateVideoItems
} from '$lib/stores/streamStore'
import {
is_feature_restream_enabled
} from '$lib/stores/remoteConfigStore'
import { is_feature_restream_enabled } from '$lib/stores/remoteConfigStore'
import DrawerRestream from '$lib/components/Channel/Chat/DrawerRestream.svelte'
let channel: any,
Expand Down Expand Up @@ -301,11 +299,10 @@
})
</script>

{#if $is_feature_restream_enabled}
{#if $is_feature_restream_enabled && !$is_sharing_screen && !$is_sharing_webcam && !$is_sharing_audio && isHostOrGuest}
<DrawerRestream />
{/if}


{#if channel && channel._id === $page.params.channelId}
<div class="relative h-full bg-base-200 overflow-hidden flex">
<div
Expand Down

0 comments on commit f99d7df

Please sign in to comment.