From 06dd2202f6e30451ba18bc5c2eab00bd34c17305 Mon Sep 17 00:00:00 2001 From: Alexis Faizeau Date: Tue, 15 Feb 2022 16:00:35 +0100 Subject: [PATCH] Fix hidden main cowebsite swape --- front/src/Components/EmbedScreens/CamerasContainer.svelte | 2 +- .../Components/EmbedScreens/CoWebsiteThumbnailSlot.svelte | 6 +++--- front/src/Stores/EmbedScreensStore.ts | 6 +++--- front/src/WebRtc/CoWebsiteManager.ts | 7 +++++++ 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/front/src/Components/EmbedScreens/CamerasContainer.svelte b/front/src/Components/EmbedScreens/CamerasContainer.svelte index 208ae529..6b4382d9 100644 --- a/front/src/Components/EmbedScreens/CamerasContainer.svelte +++ b/front/src/Components/EmbedScreens/CamerasContainer.svelte @@ -3,7 +3,7 @@ import { streamableCollectionStore } from "../../Stores/StreamableCollectionStore"; import MediaBox from "../Video/MediaBox.svelte"; - export let highlightedEmbedScreen: EmbedScreen | null; + export let highlightedEmbedScreen: EmbedScreen | undefined; export let full = false; $: clickable = !full; diff --git a/front/src/Components/EmbedScreens/CoWebsiteThumbnailSlot.svelte b/front/src/Components/EmbedScreens/CoWebsiteThumbnailSlot.svelte index b01dbf0a..e7345223 100644 --- a/front/src/Components/EmbedScreens/CoWebsiteThumbnailSlot.svelte +++ b/front/src/Components/EmbedScreens/CoWebsiteThumbnailSlot.svelte @@ -73,9 +73,9 @@ $mainCoWebsite !== undefined && $mainCoWebsite.getId() === coWebsite.getId(); isHighlight = - $highlightedEmbedScreen !== null && - $highlightedEmbedScreen.type === "cowebsite" && - $highlightedEmbedScreen.embed.getId() === coWebsite.getId(); + $highlightedEmbedScreen !== undefined && + $highlightedEmbedScreen?.type === "cowebsite" && + $highlightedEmbedScreen?.embed.getId() === coWebsite.getId(); } diff --git a/front/src/Stores/EmbedScreensStore.ts b/front/src/Stores/EmbedScreensStore.ts index 724733b3..172ec45b 100644 --- a/front/src/Stores/EmbedScreensStore.ts +++ b/front/src/Stores/EmbedScreensStore.ts @@ -15,7 +15,7 @@ export type EmbedScreen = }; function createHighlightedEmbedScreenStore() { - const { subscribe, set, update } = writable(null); + const { subscribe, set, update } = writable(undefined); return { subscribe, @@ -23,7 +23,7 @@ function createHighlightedEmbedScreenStore() { set(embedScreen); }, removeHighlight: () => { - set(null); + set(undefined); }, toggleHighlight: (embedScreen: EmbedScreen) => { update((currentEmbedScreen) => @@ -36,7 +36,7 @@ function createHighlightedEmbedScreenStore() { currentEmbedScreen.type === "streamable" && embedScreen.embed.uniqueId !== currentEmbedScreen.embed.uniqueId) ? embedScreen - : null + : undefined ); }, }; diff --git a/front/src/WebRtc/CoWebsiteManager.ts b/front/src/WebRtc/CoWebsiteManager.ts index 5a3585f6..a33432dc 100644 --- a/front/src/WebRtc/CoWebsiteManager.ts +++ b/front/src/WebRtc/CoWebsiteManager.ts @@ -561,6 +561,13 @@ class CoWebsiteManager { coWebsites.remove(coWebsite); coWebsites.add(coWebsite, 0); + if (mainCoWebsite) { + const iframe = mainCoWebsite.getIframe(); + if (iframe) { + iframe.style.display = "block"; + } + } + if ( isMediaBreakpointDown("lg") && get(embedScreenLayout) === LayoutMode.Presentation &&