From 6d7b6ec606aaccb9c7023d050a25c3fd3e051934 Mon Sep 17 00:00:00 2001 From: sitara-dev Date: Mon, 30 Oct 2023 13:29:51 +0530 Subject: [PATCH 1/3] separate drawer --- .../Channel/Chat/DrawerRestream.svelte | 20 +++---------------- .../Channel/Stream/StreamControls.svelte | 17 ++++++++++++---- src/routes/channel/[channelId]/+page.svelte | 9 +++++++++ 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/src/lib/components/Channel/Chat/DrawerRestream.svelte b/src/lib/components/Channel/Chat/DrawerRestream.svelte index 6b41e8f0..91c0390c 100644 --- a/src/lib/components/Channel/Chat/DrawerRestream.svelte +++ b/src/lib/components/Channel/Chat/DrawerRestream.svelte @@ -3,7 +3,7 @@ import { get, put, del } from '$lib/api.js' import { page } from '$app/stores' import { isValidURL } from '$lib/utils' - import IconRestream from '$lib/assets/icons/channel/IconRestream.svelte' + import { is_restream_drawer_open } from '$lib/stores/channelStore' $: auth = { userId: $page.data.user?.userId, @@ -79,22 +79,8 @@
- -
- - - -
+ +
diff --git a/src/routes/channel/[channelId]/+page.svelte b/src/routes/channel/[channelId]/+page.svelte index 34b715d1..9e530ef4 100644 --- a/src/routes/channel/[channelId]/+page.svelte +++ b/src/routes/channel/[channelId]/+page.svelte @@ -22,6 +22,10 @@ is_sharing_audio, updateVideoItems } from '$lib/stores/streamStore' + import { + is_feature_restream_enabled + } from '$lib/stores/remoteConfigStore' + import DrawerRestream from '$lib/components/Channel/Chat/DrawerRestream.svelte' let channel: any, isDeleteModalOpen = false, @@ -297,6 +301,11 @@ }) +{#if $is_feature_restream_enabled} + +{/if} + + {#if channel && channel._id === $page.params.channelId}
Date: Mon, 30 Oct 2023 13:04:21 -0500 Subject: [PATCH 2/3] Fix: changed Cancel to Close in DrawerRestream --- src/lib/components/Channel/Chat/DrawerRestream.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/Channel/Chat/DrawerRestream.svelte b/src/lib/components/Channel/Chat/DrawerRestream.svelte index 7c9ac054..cb90c644 100644 --- a/src/lib/components/Channel/Chat/DrawerRestream.svelte +++ b/src/lib/components/Channel/Chat/DrawerRestream.svelte @@ -205,7 +205,7 @@ class="btn btn-neutral text-white grow w-full" on:click={() => { document.getElementById('overlay')?.click() - }}>Cancel + }}>Close
From 7748bf0fefa2956857370679318b80e4fe5ad0fa Mon Sep 17 00:00:00 2001 From: Gagan Suie Date: Mon, 30 Oct 2023 13:30:52 -0500 Subject: [PATCH 3/3] Fix: enabling and disabling restream --- package.json | 2 +- .../Channel/Stream/StreamControls.svelte | 27 ++++++++++++------- src/lib/stores/channelStore.ts | 2 -- src/routes/channel/[channelId]/+page.svelte | 9 +++---- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 4da9af1a..305fbda7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mage-website", - "version": "0.1.07", + "version": "0.1.08", "license": "GPL-3.0", "private": true, "type": "module", diff --git a/src/lib/components/Channel/Stream/StreamControls.svelte b/src/lib/components/Channel/Stream/StreamControls.svelte index ade353d9..87d7615c 100644 --- a/src/lib/components/Channel/Stream/StreamControls.svelte +++ b/src/lib/components/Channel/Stream/StreamControls.svelte @@ -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, @@ -350,7 +348,6 @@ subs() }) }) -
@@ -417,12 +414,22 @@ !videoItemIsActive}> - {#if $is_feature_restream_enabled} - {/if} diff --git a/src/lib/stores/channelStore.ts b/src/lib/stores/channelStore.ts index 74b9fa31..1639027f 100644 --- a/src/lib/stores/channelStore.ts +++ b/src/lib/stores/channelStore.ts @@ -12,5 +12,3 @@ export const is_chat_drawer_destroy: Writable = writable(false) export const was_chat_drawer_closed: Writable = writable(false) export const is_restream_drawer_open: Writable = writable(false) -export const is_restream_drawer_destroy: Writable = writable(false) -export const was_restream_drawer_closed: Writable = writable(false) diff --git a/src/routes/channel/[channelId]/+page.svelte b/src/routes/channel/[channelId]/+page.svelte index 9e530ef4..a436db67 100644 --- a/src/routes/channel/[channelId]/+page.svelte +++ b/src/routes/channel/[channelId]/+page.svelte @@ -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, @@ -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, @@ -301,11 +299,10 @@ }) -{#if $is_feature_restream_enabled} +{#if $is_feature_restream_enabled && !$is_sharing_screen && !$is_sharing_webcam && !$is_sharing_audio && isHostOrGuest} {/if} - {#if channel && channel._id === $page.params.channelId}